Add new comment
Do you like HowtoForge? Please consider supporting us by becoming a subscriber.
|
copy and paste to bond_setup.sh, sh ./bond_setup.sh
<code> #!/bin/bash # Quick and dirty script to setup bonding on Slackware-12.2 # 12/20/2008 Joey Trungale <joey@trungale.net> MODULE=e1000e NIC0=eth1 NIC1=eth2 set -e echo echo "Compiling ifenslave..." cd /usr/src/linux/Documentation/networking gcc -Wall -O -I/usr/src/linux/include ifenslave.c -o ifenslave strip ifenslave echo "Installing ifenslave..." cp ifenslave /sbin/ifenslave echo "Creating rc.bond script..." cd /etc/rc.d touch rc.bond chmod 755 rc.bond cat <<EOF> rc.bond #!/bin/sh case "\$1" in 'start') echo "start bond0" #modprobe bonding mode=balance-alb miimon=100 modprobe bonding mode=balance-rr miimon=100 modprobe $MODULE ifconfig bond0 up ifenslave bond0 $NIC0 ifenslave bond0 $NIC1 #TODO need to be changed #ifconfig bond0 hw ether 00:16:3e:aa:aa:aa ;; 'stop') ifconfig bond0 down rmmod bonding rmmod $MODULE ;; *) echo "Usage: \$0 {start|stop}" ;; esac EOF echo "Patching rc.M to start rc.bond on startup..." patch -s -p0 rc.M <<EOF --- rc.M 2008-12-20 08:37:48.000000000 -0600 +++ rc.M.new 2008-12-20 08:38:47.000000000 -0600 @@ -82,6 +82,11 @@ fi fi +# If script rc.bond is executable then start it +if [ -x /etc/rc.d/rc.bond ]; then + . /etc/rc.d/rc.bond start +fi + # Initialize the networking hardware. if [ -x /etc/rc.d/rc.inet1 ]; then . /etc/rc.d/rc.inet1 EOF cat <<EOF Dont forget to add the following to /etc/rc.d/rc.inet1.conf: IFNAME[4]="bond0" IPADDR[4]="XXX.XX.XX.XX" NETMASK[4]="255.255.255.0" USE_DHCP[4]="" DHCP_HOSTNAME[4]="" Also, you may wish to choose a different method of bonding, modify the 'mode=' option in rc.bond to one of the settings from /usr/src/linux/Documentation/networking/bonding.txt. Enjoy! EOF </code>
Reply |





Recent comments
7 hours 23 min ago
9 hours 6 min ago
11 hours 31 min ago
11 hours 37 min ago
16 hours 11 min ago
18 hours 12 min ago
21 hours 36 min ago
23 hours 42 min ago
23 hours 53 min ago
1 day 2 hours ago