Quote:
Originally Posted by sc425000
Hi EveryBody
I have problem with bonding network interface . When I config bonding complete and test unplug network bonding work fine. But after reboot I test unplug network cable again and I see bonding not work. Then I use command "service network restart" and test unplug cable . Bonding just work fine
This is my config
/etc/modprobe.conf
alias eth0 tg3
alias eth0 tg3
alias bond0 bonding
options bond0 mode=1 miimon=100
/etc/sysconfig/network-scripts/ifcfg-bond0
DEVICE=bond0
IPADDR=10.65.24.60
NETMASK=255.255.255.0
NETWORK=10.65.24.0
GATEWAY=10.65.24.254
BROADCAST=10.65.24.255
ONBOOT=yes
BOOTPROTO=none
USERCTL=no
/etc/sysconfig/network-scripts/ifcfg-eth0
DEVICE=eth0
USERCTL=no
BOOTPROTO=none
ONBOOT=yes
MASTER=bond0
SLAVE=yes
TYPE=Ethernet
ETHTOOL_OPTS="speed 100 duplex full autoneg off"
/etc/sysconfig/network-scripts/ifcfg-eth1
DEVICE=eth0
USERCTL=no
BOOTPROTO=none
ONBOOT=yes
MASTER=bond0
SLAVE=yes
TYPE=Ethernet
ETHTOOL_OPTS="speed 100 duplex full autoneg off"
Something wrong ?
THX
|
also, take the autoneg line off.
u could always use this script:
Code:
#!/bin/bash
#
#script used to set up channel bonding in RHEL
#
#define $hostname
HOST_NAME=$(hostname)
#look up ip for system
DNS_IP=$(nslookup $HOST_NAME | grep -A 1 Name | awk 'NR==2 {print $2}')
if [ "$DNS_IP" == "" ]; then
echo "Could not find the IP in DNS!"
exit 1
fi
#define $gw
GATEWAY=$(route -n | grep '^0\.0\.0\.0.*' | awk '{print $2}')
if [ "$GATEWAY" == "" ]; then
echo "Could not find the GATEWAY!"
exit 1
fi
#define netmask
NETMASK=$(ifconfig eth0 | grep Mask | awk '{split($4,a,":"); print a[2]'})
if [ "$NETMASK" == "" ]; then
echo "Could not find the NETMASK!"
exit 1
fi
#copy orig files
cp /etc/sysconfig/network /etc/sysconfig/network.orig
#create new /etc/sysconfig/network file
# Verify that this is not already configured and modify the setting
# if it is.
if [ ! $(grep 'GATEWAY=' /etc/sysconfig/network) ]; then
echo "GATEWAY=$GATEWAY" >> /etc/sysconfig/network
else
mv /etc/sysconfig/network /etc/sysconfig/network.orig
cat /etc/sysconfig/network.orig | sed "s/GATEWAY=.*/GATEWAY=$GATEWAY/" > /etc/sysconfig/network
fi
#copy orig files
cp /etc/sysconfig/network-scripts/ifcfg-eth0 /etc/sysconfig/network-scripts/backup/ifcfg-eth0.orig
cp /etc/sysconfig/network-scripts/ifcfg-eth1 /etc/sysconfig/network-scripts/backup/ifcfg-eth1.orig
#create bond0 config file
cat > /etc/sysconfig/network-scripts/ifcfg-bond0 << BOND0
DEVICE=bond0
IPADDR=$DNS_IP
NETMASK=$NETMASK
ONBOOT=yes
BOOTPROTO=none
USERCTL=no
BOND0
#create interface(s) config file
for ETH in $(ifconfig | grep eth | awk '{print $1}'); do
SPEED=$(ethtool $ETH | grep Speed | awk '{split($2,a,"M"); print a[1]}')
cat > /etc/sysconfig/network-scripts/ifcfg-$ETH << NIC1
DEVICE=$ETH
USERCTL=no
ONBOOT=yes
MASTER=bond0
SLAVE=yes
BOOTPROTO=none
ETHTOOL_OPTS="speed $SPEED duplex full"
NIC1
done
#copy orig files
cp /etc/resolv.conf /etc/resolv.conf.orig
#create /etc/resolv.conf file
cat > /etc/resolv.conf << DNS
search aepsc.com
nameserver 10.90.128.2
nameserver 10.70.0.1
nameserver 10.20.0.1
DNS
#copy orig files
cp /etc/modprobe.conf /etc/modprobe.orig
#configure the required modules
echo "alias bond0 bonding options bond0 miimon=100 mode=1" >> /etc/modprobe.conf
#restart networking
reboot