常用操作系统双网卡绑定方法

合集下载
  1. 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
  2. 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
  3. 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。

常用操作系统双网卡绑定方法

目录

一、RHEL 5.7 LINUX 下网卡绑定设置 (1)

二、RHEL6 LINUX 下网卡绑定设置 (3)

三、SUSE 10 下网卡绑定设置 (11)

四、SUSE 11 下网卡绑定设置 (16)

五、Windows 下网卡绑定设置 (22)

一、RHEL 5.7 LINUX 下网卡绑定设置

[root@Linux5 ~]# more /etc/sysconfig/network-scripts/ifcfg-bond0

# Broadcom Corporation NetXtreme II BCM5709S Gigabit Ethernet

DEVICE=bond0

BOOTPROTO=static

ONBOOT=yes

IPADDR=10.96.19.207

NETMASK=255.255.255.0

GATEWAY=10.96.19.1

TYPE=Ethernet

[root@Linux5 ~]# more /etc/sysconfig/network-scripts/ifcfg-eth0

# Broadcom Corporation NetXtreme II BCM5709S Gigabit Ethernet

DEVICE=eth0

BOOTPROTO=none

HWADDR=34:40:B5:BD:24:18

ONBOOT=yes

MASTER=bond0

SLAVE=yes

TYPE=Ethernet

[root@Linux5 ~]# more /etc/sysconfig/network-scripts/ifcfg-eth1

# Broadcom Corporation NetXtreme II BCM5709S Gigabit Ethernet

DEVICE=eth1

BOOTPROTO=none

HWADDR=34:40:B5:BD:24:1A

ONBOOT=yes

MASTER=bond0

SLAVE=yes

TYPE=Ethernet

[root@Linux5 ~]# more /proc/net/bonding/bond0

Ethernet Channel Bonding Driver: v3.4.0-1 (October 7, 2008)

Bonding Mode: fault-tolerance (active-backup)

Primary Slave: None

Currently Active Slave: eth0

MII Status: up

MII Polling Interval (ms): 100

Up Delay (ms): 0

Down Delay (ms): 0

Slave Interface: eth0

MII Status: up

Speed: 1000 Mbps

Duplex: full

Link Failure Count: 6

Permanent HW addr: 34:40:b5:bd:24:18

Slave Interface: eth1

MII Status: down

Speed: 1000 Mbps

Duplex: full

Link Failure Count: 6

Permanent HW addr: 34:40:b5:bd:24:1a

[root@Linux5 ~]# more /etc/modprobe.conf

alias eth0 bnx2

alias eth1 bnx2

alias eth2 bnx2

alias eth3 bnx2

alias scsi_hostadapter mptbase

alias scsi_hostadapter1 mptsas

alias scsi_hostadapter2 usb-storage

alias net-pf-10 off

alias ipv6 off

options ipv6 disable=1

alias usb0 usbnet

alias usb1 usbnet

alias bond0 bonding

options bond0 miimon=100 mode=1 primary=eth0

关于路由的配置,做如下说明,

1)使用route 命令添加的路由,机器重启或者网卡重启后路由就失效了,方法:

//添加到主机的路由

# route add –host 192.168.168.110 dev eth0

# route add –host 192.168.168.119 gw 192.168.168.1

//添加到网络的路由

# route add –net IP网段 netmask MASK eth0

# route add –net IP网段 netmask MASK gw IP

# route add –net IP网段 /24 eth1

//添加默认网关

# route add default gw IP

//删除路由

# route del –host 192.168.168.110 dev eth0

2)在linux下设置永久路由的方法(选其一即可)

a. 将命令写入开机脚本/etc/rc.local

b. route add -net 192.168.3.0/24 dev eth0

route add -net 192.168.2.0/24 gw 192.168.3.254

c. /etc/sysconfig/static-router :

any net x.x.x.x/24 gw y.y.y.y

二、RHEL6 LINUX 下网卡绑定设置

To configure the bond0 device with the network interface eth0 and eth1, perform the following steps:

1. Create a new file as root named bonding.conf in the /etc/modprobe.d/ directory. Insert the following line in this new file:

alias bond0 bonding

2. Create the channel bonding interface file ifcfg-bond0 in

the/etc/sysconfig/network-scripts/ directory:

# cat /etc/sysconfig/network-scripts/ifcfg-bond0

DEVICE=bond0

相关文档
最新文档