we have a DHCP server where i specify the hostname,, and address:
Code: Select all
host RemoteHost{ hardware ethernet 01:02:03:85:6d:5d; fixed-address 192.168.1.89; filename "pxelinux.0";}
Code: Select all
systemctl disable NetworkManager
systemctl stop NetworkManager
systemctl enable network
Code: Select all
network --device=bond0 --noipv6 --bootproto dhcp --onboot=yes --bondslaves=eno49,eno50 --bondopts=mode=active-backup,primary=eno49,miimon=80,updelay=60000
Here is one example (that isnt working):
Code: Select all
NICNAMES=$(/sbin/ifconfig -a | sed 's/[ \t].*//;/^\(lo\|\)$/d'| cut -d: -f1)
for i in $NICNAMES
do
IPADDRESS=$(/sbin/ifconfig $i | grep inet | awk '{print $2}'| awk '{print $1;exit}')
NETMASK=$(/sbin/ifconfig $i | grep netmask | awk '{print $4}'| awk '{print $1;exit}')
STATUS=$(ethtool $i | grep 'Link detected' | awk -F: '{print $2}')
if [ $STATUS == 'yes' ]
then
COUNTER=$((COUNTER+1))
NIC[$COUNTER]="$i"
fi
done
cat << 'EOF' >/etc/sysconfig/network-scripts/ifcfg-bond0
DEVICE=bond0
BOOTPROTO=none
ONBOOT=yes
IPADDR=$IPADDRESS
NETMASK=$NETMASK
USERCTL=no
BONDING_MASTER=yes
BONDING_OPs="mode=active-backup miimon=80 updelay=60000 primary=${NIC[1]}"
EOF
Code: Select all
cat <<'EOF'> /etc/sysconfig/network-scripts/ifcfg-eno49
NAME=eno49
TYPE=Ethernet
BOOTPROTO=none
ONBOOT=yes
MASTER=bond0
SLAVE=yes
EOF
Code: Select all
cat <<'EOF'> /etc/sysconfig/network-scripts/ifcfg-eno50
NAME=eno50
TYPE=Ethernet
BOOTPROTO=none
ONBOOT=yes
MASTER=bond0
SLAVE=yes
EOF