[sentinix-list] Bonding & dhcp

"S. Bonnegent" <[email protected]>
Newsgroups gmane.linux.sentinix
Organization sensIA
Message-ID <[email protected]>
Hi,

My Sentinix box has 3 networks devices, I use one for the connection to internet (eth0) and
2 for my home network on a bonding device (eth1+eth2 = bond0). I installed the beta1 of Sentinix.
According to the documentation in the kernel (Documentation/networking/bonding.txt), I compiled 
"ifenslave" (it wasn't present in the distrib) and copied it in "/sbin/ifenslave". The compilation 
command is:
    # gcc -Wall -Wstrict-prototypes -O ifenslave.c -o ifenslave

In order to configure correctly the bonding device, I have modified some files:

/etc/NETCONFIG:

SX_GATEWAY=10.3.3.3
SX_NAMESERVER1=212.27.32.5
SX_NAMESERVER2=213.228.0.168
SX_NETDEV_eth0_IP=10.3.3.33
SX_NETDEV_eth0_NETMASK=255.255.255.0
SX_NETDEV_bond0_IP=10.3.5.14
SX_NETDEV_bond0_NETMASK=255.255.255.0
SX_NETDEV_eth1_IP=bonding
SX_NETDEV_eth1_MASTER=bond0
SX_NETDEV_eth2_IP=bonding
SX_NETDEV_eth2_MASTER=bond0

and added this lines in /etc/rc.d/rc.inet1 ("diff -u" result)

--- /etc/rc.d/rc.inet1	2003-10-25 16:27:06.000000000 +0200
+++ my-rc.inet1	2003-12-20 17:47:57.000000000 +0100
@@ -30,6 +30,7 @@
 do
     IP=`printenv SX_NETDEV_${ETH}_IP`
     NETMASK=`printenv SX_NETDEV_${ETH}_NETMASK`
+    BOND=`printenv SX_NETDEV_${ETH}_MASTER`
 
 	if [ "$IP" = "dhcp" -o "$IP" = "DHCP" -o "$IP" = "Dhcp" ]; then
 		echo -e "\033[1mConfiguring ${ETH} by contacting a DHCP server...\033[0m"
@@ -41,6 +42,9 @@
 			echo "$hostsfile" | grep -v "`cat /etc/HOSTNAME` `cat /etc/HOSTNAME | cut -d. -f1`" > /etc/hosts
 			echo "${IP}	`cat /etc/HOSTNAME` `cat /etc/HOSTNAME | cut -d. -f1`" >> /etc/hosts
 		fi
+	elif [  "$IP" = "bonding" -a ! "$BOND" = "" ]; then
+		echo -e "\033[1mConfiguring ${ETH} as slave with bonding interface: ${BOND}\033[0m"
+		/sbin/ifenslave ${BOND} ${ETH}
 	elif [ ! "$IP" = "" -a ! "$NETMASK" = "" ]; then
 		BROADCAST=`/bin/ipmask $NETMASK $IP | cut -f1 '-d '`
 		NETWORK=`/bin/ipmask $NETMASK $IP | cut -f2 '-d '`

Now, all is ok.

Finally, I have modified some files to start and stop the Dhcp server:

/etc/rc.d/rc.M:

--- /etc/rc.d/rc.M	2003-10-24 23:27:57.000000000 +0200
+++ my-rc.M	2003-12-20 17:48:04.000000000 +0100
@@ -61,6 +61,11 @@
   . /etc/rc.d/rc.ntpd start
 fi
 
+# Start the DHCP server
+if [ -x /etc/rc.d/rc.dhcpd ]; then
+  . /etc/rc.d/rc.dhcpd start
+fi
+
 # Fire up openMosix cluster
 if [ -x /etc/rc.d/rc.openmosix ]; then
   . /etc/rc.d/rc.openmosix start

/etc/rc.d/rc.0

--- /etc/rc.d/rc.0	2003-07-05 04:46:09.000000000 +0200
+++ my-rc.0	2003-12-20 17:48:08.000000000 +0100
@@ -41,6 +41,11 @@
 #  fi
 fi
 
+# Stop DHCP server
+if [ -x /etc/rc.d/rc.dhcpd ]; then
+    . /etc/rc.d/rc.dhcpd stop
+fi
+
 if [ -x /etc/rc.d/rc.openmosix ]; then
     . /etc/rc.d/rc.openmosix stop
 fi

Except this, Sentinix seems to be a really good distrib. Congratulations !
I hope that my mail can help you.

I have some troubles with my Adaptec RAID 1200A but it's probably a 
misconfiguration problem :-)

Best regards

Bonnegent Sebastien
_____________________________________________________________________
Envie de discuter en "live" avec vos amis ? Télécharger MSN Messenger
http://www.ifrance.com/_reloc/m la 1ère messagerie instantanée de France
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.