2015年9月10日 星期四

CentOS 6.4 綁訂雙網卡


1、查看主机网卡
[root@web ~]# cd /etc/sysconfig/network-scripts/
[root@web1 network-scripts]# ll
total 200
-rw-r--r--. 1 root root   212 Mar 20 22:15 ifcfg-eth0
-rw-r--r--  1 root root   212 Mar 23 19:10 ifcfg-eth1

2、复制ifcfg-bond0
[root@web network-scripts]# cp ifcfg-eth0 ifcfg-bond0
[root@web network-scripts]# ll
total 204
-rw-r--r--  1 root root   212 Mar 23 19:12 ifcfg-bond0
-rw-r--r--. 1 root root   212 Mar 20 22:15 ifcfg-eth0
-rw-r--r--  1 root root   212 Mar 23 19:10 ifcfg-eth1

3、编辑ifcfg-bond0ifcfg-eth0ifcfg-eth1
[root@web network-scripts]# vim ifcfg-bond0
DEVICE=bond0
BOOTPROTO=static
IPADDR=10.1.3.210
NETMASK=255.255.255.0
GATEWAY=10.1.3.254
ONBOOT=yes
USERCTL=no

[root@web1 network-scripts]# vim ifcfg-eth0
DEVICE=eth0
ONBOOT=yes
BOOTPROTO=none
MASTER=bond0
SLAVE=yes
USERCTL=no

[root@web1 network-scripts]# vim ifcfg-eth1
DEVICE=eth1
ONBOOT=yes
BOOTPROTO=none
MASTER=bond0
SLAVE=yes
USERCTL=no

4、模块加载
[root@web1 ~]# vim /etc/modprobe.d/dist.conf 
在最后添加以下内容:
#加载bonding模块,对外虚拟网络接口设备为 bond0

alias bond0 bonding
options bond0 miimon=100 mode=6

1 則留言:

  1. HP DL380 Gen9 Rack Server in UAE, Proliant 2U Rack Server in UAE, Rack Server in UAE
    https://gccgamers.com/hp-dl380.html
    HP DL380 Gen9 Rack Server in UAE, Safe Shopping Multiple Payment Options Express Delivery GCC Gamers Moneyback Guarantee.
    1634536874551-8

    回覆刪除