Network configuration on OpenSolaris

network

Static IP address

Assigning a static IP address on OpenSolaris is accomplished by editing the hostname files in the directory /etc. For example, assign a static IP address to interface bge0 by editing /etc/hostname.bge0:

192.168.0.123

Set the netmask by editing the file /etc/inet/netmasks:

192.168.0.0 255.255.255.0

Set the default gateway by editing the file /etc/defaultrouter:

192.168.0.1

Network interface bonding

In this example, 10.0.0.1 is the interface of the bond, 10.0.0.2 and 10.0.0.3 are test addresses. Start by editing /etc/hostname.e1000g0:

10.0.0.2 netmask + broadcast + group production
deprecated addif 10.0.0.1 netmask + broadcast + failover up

Then edit /etc/hostname.e1000g1:

10.0.0.3 netmask + broadcast + group production
deprecated + failover standby up

Network configuration on CentOS

network

Static IP address

Assigning a static IP address on CentOS is accomplished by editing the files in the directory /etc/sysconfig/network-scripts. For example, assign a static IP address to interface eth0 by editing /etc/sysconfig/network-scripts/ifcfg-eth0:

DEVICE=eth0
BOOTPROTO=none
IPADDR=192.168.0.123
NETMASK=255.255.255.0
GATEWAY=192.168.0.1
ONBOOT=yes

Network interface bonding

To achieve higher bandwidth and/or reliability, network interfaces can be bonded. First, edit the file /etc/sysconfig/network-scripts/ifcfg-bond0:

DEVICE=bond0
BOOTPROTO=none
IPADDR=10.0.0.1
NETMASK=255.255.255.0
ONBOOT=yes

After that, you need to edit the network interfaces that are part of this bond, e.g. eth1 and eth2. Let’s start with /etc/sysconfig/network-scripts/ifcfg-eth1:

DEVICE=eth1
BOOTPROTO=none
MASTER=bond0
SLAVE=yes
ONBOOT=yes

Then edit /etc/sysconfig/network-scripts/ifcfg-eth2:

DEVICE=eth2
BOOTPROTO=none
MASTER=bond0
SLAVE=yes
ONBOOT=yes

The last file to edit is /etc/modprobe.conf:

alias bond0 bonding
options bond0 mode=active-backup miimon=100

The mode value in this last file can be one of several:

  • balance-rr
  • active-backup
  • balance-xor
  • 802.3ad
  • balance-tlb
  • balance-alb

In the active-backup mode shown in the example, only one slave in the bond is active. A different slave becomes active if, and only if, the active slave fails. The bond’s MAC address is externally visible on only one port (network interface) to avoid confusing the switch.

The option miimon (media-independent interface monitoring) defines how often, in milliseconds, link monitoring occurs.