在Linux上怎么两个网卡配同一个IP?

在Linux上怎么两个网卡配同一个IP?

听说可以实现的

好像怎么关闭ARP??

反正就是可以实现的。

谁会做,或者有教程的请教下
把步骤写详细一点

最好有PPT或文本视频教程的东西

谢谢了

linux中双网卡的梆定

创建一个bond设备,三个简单的步骤即可搞定:
(1)首先要保证相应的驱动程序已经加载:
localhost@root ~# modprobe bonding
或 modprobe <3c59x| eepro100|pcnet32|tulip|...>
(2)其次给等梆定bond设备分配IP地址
localhost@root ~# ifconfig bond0 <IP地址> netmask <子网掩码> broadcast <广播地址 >
例如 ifconfig bond0 192.168.1.242 netmask 255.255.255.0 broadcast 172.31.3.254
(3)最后将所有要梆定的物理网卡接口添加到bond设备中去
localhost@root ~# ifenslave bond0 [{-f|--force} bond0 eth0 [ eth1 [eth2]...]
例如 ifenslave bond0 eth0 eth1 梆定了eth0 eth1两个网卡设备。 --force 表示强制进行梆定

创建好bond设备后,就可以像一般的网卡设备一样使用了
如启动bond0: # ifconfig bond0 up
停用bond0: # ifconfig bond0 down
在不停用bond0的情况下添加接口: # ifenslave {-d| --detach} bond0 eth0 [eth1 [eth2]...]
--detach表示"附加"的意思
改变活动的从设备: # ifenslave {-c|--change-active} bond0 eth0
--change-acitve 表示"改变活动的从设备"的意思
显示主接口(指bond0)信息: # ifenslave bond0
显示所以接口信息: # ifenslave {-a|--all-interfaces}
--all-interfaces 表示"所有接口"
温馨提示:内容为网友见解,仅供参考
第1个回答  推荐于2016-02-05

在同一个子网中,不可能出现两个设备对应同一个IP地址的,如果想用同一个IP访问两个网卡,可以用以下方法:

    域名解析 把同一个域名在DNS指向这两个网卡,这样可以通过同一个域名访问两个网卡(一般是轮循)

    集群 把这两个网卡加入到一个集群中,然后设置一个集群IP。