问题:服务器要使用两张网卡做bond0以实现网络冗余和提高带宽
处理方法:
例:新上架山东烟台要做bond0
61.162.184.109 255.255.255.224 61.162.184.97
配置之前先备份之前的网卡文件
cp /etc/sysconfig/network-scripts/ifcfg-eth1 ifcfg-bind0
touch /etc/modprobe.d/bonding.conf
vi /etc/modprobe./bonding.conf //创建文件并添加内容
lias bond0 bonding
cat /etc/sysconfig/network-scripts/ifcfg-eth1
DEVICE=eth1
ONBOOT=yes
SLAVE=yes
MASTER=bond0
HOTPLUG=no
TYPE=Ethernet
BOOTPROTO=none
cat /etc/sysconfig/network-scripts/ifcfg-eth2
DEVICE=eth2
ONBOOT=yes
SLAVE=yes
MASTER=bond0
HOTPLUG=no
TYPE=Ethernet
BOOTPROTO=none
cat /etc/sysconfig/network-scripts/ifcfg-bind0
DEVICE=bond0
ONBOOT=yes
BONDING_OPTS="mode=0 miimon=100"
TYPE=Ethernet
BOOTPROTO=none
IPADDR=61.162.184.109
NETMASK=255.255.255.224
GATEWAY=61.162.184.97
重启网卡:
service netowork restart
或 ifconfig eth2 up 或 ifup eth2
以下只是一张网卡的信息,其主要作用是查看该网卡是否连接网线或与上层设备是否互通。
注:查看网卡信息:
[[email protected] ~]# ethtool eth1
Settings for eth1:
Supported ports: [ TP ]
Supported link modes: 10baseT/Half 10baseT/Full
100baseT/Half 100baseT/Full
1000baseT/Full
Supported pause frame use: Symmetric
Supports auto-negotiation: Yes
Advertised link modes: 10baseT/Half 10baseT/Full
100baseT/Half 100baseT/Full
1000baseT/Full //网卡可适用的速率
Advertised pause frame use: Symmetric
Advertised auto-negotiation: Yes
Speed: 1000Mb/s //现在使用的速率
Duplex: Full
Port: Twisted Pair
PHYAD: 1
Transceiver: internal
Auto-negotiation: on
MDI-X: Unknown
Supports Wake-on: pumbg
Wake-on: g
Current message level: 0x00000007 (7)
drv probe link
Link detected: yes //网卡是否激活