企業IT人員在進行Linux系統部署的時候一定面臨網卡綁定的問題,嘉為根據多年Linux系統運維經驗針對企業主流Linux系統RHEL6、RHEL7的網卡綁定整理了一套腳本文件,現在分享給大家。
針對RHEL6的多台交換機,非LACP聚合。192.168.100.100/24 vip地址
DEVICE=bond0
ONBOOT=yes
BOOTPROTO=static
IPADDR=192.168.100.100
NETMASK=255.255.255.0
GATEWAY=192.168.100.1
USERCTL=no
NM_CONTROLLED=no
BONDING_OPTS="mode=1 primary=eth0 miimon=100"
DEVICE=eth0
BOOTPROTO=none
ONBOOT=yes
MASTER=bond0
SLAVE=yes
USERCTL=no
NM_CONTROLLED=no
DEVICE=eth1
BOOTPROTO=none
ONBOOT=yes
MASTER=bond0
SLAVE=yes
USERCTL=no
NM_CONTROLLED=no
針對RHEL6:多台交換機,LACP聚合。192.168.100.100/24 vip地址
DEVICE=bond0
ONBOOT=yes
BOOTPROTO=static
IPADDR=192.168.100.100
NETMASK=255.255.255.0
GATEWAY=192.168.100.1
USERCTL=no
NM_CONTROLLED=no
BONDING_OPTS="mode=4 miimon=100 xmit_hash_policy=layer2+3"
DEVICE=eth0
BOOTPROTO=none
ONBOOT=yes
MASTER=bond0
SLAVE=yes
USERCTL=no
NM_CONTROLLED=no
DEVICE=eth1
BOOTPROTO=none
ONBOOT=yes
MASTER=bond0
SLAVE=yes
USERCTL=no
NM_CONTROLLED=no
針對RHEL7:多台交換機,非LACP聚合。192.168.100.100/24 vip地址
DEVICE=bond0
ONBOOT=yes
BOOTPROTO=static
IPADDR=192.168.100.100
NETMASK=255.255.255.0
GATEWAY=192.168.100.1
USERCTL=no
NM_CONTROLLED=no
BONDING_OPTS="mode=1 primary=eth0 miimon=100"
DEVICE=eth0
BOOTPROTO=none
ONBOOT=yes
MASTER=bond0
SLAVE=yes
USERCTL=no
NM_CONTROLLED=no
DEVICE=eth1
BOOTPROTO=none
ONBOOT=yes
MASTER=bond0
SLAVE=yes
USERCTL=no
NM_CONTROLLED=no
針對RHEL7:多台交換機,LACP聚合。192.168.100.100/24 vip地址
DEVICE=bond0
ONBOOT=yes
BOOTPROTO=static
IPADDR=192.168.100.100
NETMASK=255.255.255.0
GATEWAY=192.168.100.1
USERCTL=no
NM_CONTROLLED=no
BONDING_OPTS="mode=4 miimon=100 xmit_hash_policy=layer2+3"
DEVICE=eth0
BOOTPROTO=none
ONBOOT=yes
MASTER=bond0
SLAVE=yes
USERCTL=no
NM_CONTROLLED=no
DEVICE=eth1
BOOTPROTO=none
ONBOOT=yes
MASTER=bond0
SLAVE=yes
USERCTL=no
NM_CONTROLLED=no