LinuxSir.cn,穿越时空的Linuxsir!

 找回密码
 注册
搜索
热搜: shell linux mysql
查看: 1469|回复: 1

SUSE9.3双网卡绑定配置方法

[复制链接]
发表于 2006-5-1 01:05:05 | 显示全部楼层 |阅读模式
SUSE9.3双网卡绑定配置方法:
1)效果:网卡eth0和eth1虚拟成设备bond0,并且向外公布一个虚拟IP地址。如下:
akczftp:~ # ifconfig
bond0     Link encap:Ethernet  HWaddr 00:0C:76:6C:86:1F
          inet addr:10.109.1.59  Bcast:10.255.255.255  Mask:255.255.255.0
          inet6 addr: fe80::20c:76ff:fe6c:861f/64 Scopeink
          UP BROADCAST RUNNING MASTER MULTICAST  MTU:1500  Metric:1
          RX packets:10831 errors:0 dropped:0 overruns:0 frame:0
          TX packets:476 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:1290093 (1.2 Mb)  TX bytes:164685 (160.8 Kb)

eth0      Link encap:Ethernet  HWaddr 00:0C:76:6C:86:1F
          inet addr:10.109.1.59  Bcast:10.255.255.255  Mask:255.255.255.0
          inet6 addr: fe80::20c:76ff:fe6c:861f/64 Scopeink
          UP BROADCAST RUNNING SLAVE MULTICAST  MTU:1500  Metric:1
          RX packets:5396 errors:0 dropped:0 overruns:0 frame:0
          TX packets:238 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:643234 (628.1 Kb)  TX bytes:83262 (81.3 Kb)
          Base address:0xb000 Memory:f5000000-f5020000

eth1      Link encap:Ethernet  HWaddr 00:0C:76:6C:86:1F
          inet addr:10.109.1.59  Bcast:10.255.255.255  Mask:255.255.255.0
          inet6 addr: fe80::20c:76ff:fe6c:861f/64 Scopeink
          UP BROADCAST RUNNING SLAVE MULTICAST  MTU:1500  Metric:1
          RX packets:5435 errors:0 dropped:0 overruns:0 frame:0
          TX packets:238 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:646859 (631.6 Kb)  TX bytes:81423 (79.5 Kb)
          Base address:0xc000 Memory:f9000000-f9020000

lo        Link encapocal Loopback
          inet addr:127.0.0.1  Mask:255.0.0.0
          inet6 addr: ::1/128 Scope:Host
          UP LOOPBACK RUNNING  MTU:16436  Metric:1
          RX packets:108 errors:0 dropped:0 overruns:0 frame:0
          TX packets:108 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:7288 (7.1 Kb)  TX bytes:7288 (7.1 Kb)
2)配置方法:使用VI编辑器将标有//的内容添加到/etc/init.d/network中的相应位置。mode为网卡工作方式,“1”为互援式工作方式,“2”为集群式工作方式。如下:
akczftp:~ # vi /etc/network
akczftp:~ # vi /etc/init.d/network
                        rc_status -v
                fi

//#modprobe bonding mode=active-backup miimon=100 primary=eth0
//modprobe bonding mode=0 miimon=100 primary=eth0
//ifconfig bond0 inet 10.109.1.59 netmask 255.255.255.0

//route add default gw 10.109.1.1

//ifenslave bond0 eth0

//ifenslave bond0 eth1

//ifconfig bond0 up


                ;;

        stop)

                echo Shutting down network interfaces:

echo Shutting down network interfaces:

//ifenslave -d bond0 eth0

//ifenslave -d bond0 eth1

//ifconfig bond0 down
特别感谢郑州铁路局客票系统技术支持单位文东辉工程师的帮助和指导
发表于 2006-5-1 12:37:02 | 显示全部楼层
这个方法应该是各个发行版通用的
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

快速回复 返回顶部 返回列表