Monday, June 27, 2011

Configuring multiple DHCP networks for 11gR2 Grid Infrastructure


 
In 11gR2 cluster's network, both VIPs and Private IPs can be assigned using DHCP. Generally we have to maintain separate physical networks using 2 switches for public and private networks of RAC. If we connect all public and private interfaces of nodes in cluster to same switch (this will be happen in learning environments only, for example a home setup), we cannot guarantee if VIPs and private IPS will be assigned to respective network interfaces. But we need to have VIP and Private IPs should be assigned exactly as per their networks.

Translating this problem into system administrator terms, in a physical network made using one switch; the following has to be done.
 1. A DHCP server that can assign IPs in 2 subnets: 172.16.1.0/24, 192.168.15.0/24
 2. A DHCP client having 2 interfaces eth0, eth1. In this eth0 will have an alias interface eth0:1. All these interfaces should be assigned IP addresses like this.
   a. eth0   - Static IP address in the subnet 172.16.1.0/24
   b. eth0:1 - DHCP assigned IP in the subnet 172.16.1.0/24
   c. eth1   - DHCP assigned IP in the subnet 192.168.15.0/24
And the constraint we have here is both interfaces of DHCP client connected to same switch.

After experimenting, I found this is the configuration that satisfies given requirement.

DHCP server configuration (dhcpd.conf):
class "pub-net" {
  match if option dhcp-client-identifier = "pubnet";
}

class "priv-net" {
  match if option dhcp-client-identifier = "privnet";
}


subnet 172.16.1.0 netmask 255.255.255.0 {
  pool {
    allow members of "pub-net";
    range 172.16.1.11 172.16.1.30;
    option domain-name-servers 172.16.1.1;
    option routers 172.16.1.1;
  }
}

subnet 192.168.15.0 netmask 255.255.255.0 {
  pool {
    allow members of "priv-net";
    range 192.168.15.11 192.168.15.30;
    option domain-name-servers 172.16.1.1;
    option routers 192.168.15.1;
  }
}

DHCP client configuration (/etc/dhclient.conf):
Note: New file /etc/dhclient.conf has to be created if it does not exist already.
interface "eth0:1" {
    send  dhcp-client-identifier = "pubnet";
}

interface "eth1" {
    send  dhcp-client-identifier = "privnet";
}

Testing configuration at client:
# killall -9 dhclient
# dhclient eth0:1

Now verify IP addresses for eth0:1, eth1 if we got them in correct subnets. After testing is finished please make sure you have done the following
# service network restart
This is to ensure that eth0:1 will not have any IP address assigned to it before Oracle grid infrastructure installation.

No comments:

Post a Comment