Chinaunix首页 | 论坛 | 博客
  • 博客访问: 75260
  • 博文数量: 16
  • 博客积分: 0
  • 博客等级: 民兵
  • 技术积分: 126
  • 用 户 组: 普通用户
  • 注册时间: 2013-02-27 16:04
个人简介

奋斗的蜗牛

文章分类

全部博文(16)

文章存档

2014年(13)

2013年(3)

我的朋友

分类: LINUX

2014-06-23 09:20:12

测试环境
Linux虚拟机一台 双网卡   NAT 桥接本地vmware 8网卡

[root@localhost network-scripts]# vim ifcfg-bond0
DEVICE=bond0
IPADDR=192.168.100.118
NETMASK=255.255.255.0
GETWAY=192.168.100.1
ONBOOT=yes
BOOTPROTO=static
BONDING_OPTS="mode=0"
[root@localhost network-scripts]# vim ifcfg-eth0
DEVICE=eth0
MASTER=bond0
SLAVE=yes
BOOTPROTO=static
HWADDR=00:0C:29:EE:EF:C8
ONBOOT=yes
[root@localhost network-scripts]# vim ifcfg-eth1
DEVICE=eth1
MASTER=bond0
SLAVE=yes
BOOTPROTO=static
ONBOOT=yes
[root@localhost network-scripts]# vim /etc/modprobe.conf
alias eth0 e1000
alias scsi_hostadapter mptbase
alias scsi_hostadapter1 mptspi
alias scsi_hostadapter2 ata_piix
alias eth1 e1000
alias bond0 bonding
options bond0 miimon=100 mode=1
#mode=0/1,0表示提供容错和负载均衡的功能,1表示只提供容错的功能;mode=1时可以使用primary参数指定哪块网卡作为主要优先的。
miimon=100表示连接监控的频度,单位为毫秒;
use_carrier表示如何确定连接状态;0内核检测,1由mii-tool或ethtool外部工具检测。

修改/etc/rc.d/rc.local,添加如下内容

ifenslave bond0 eth0 eth1
route add -net 192.168.1.255 netmask 255.255.255.0 bond0


重启网络服务
[root@localhost network-scripts]# service network restart

从物理机上测试Ping虚拟机bond0网卡

分别ifdown eth0/eth1   ping测试主机, 同时断掉eth0和eth1,则ping不通
阅读(2376) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~