解决VM中配置多网卡多IP只能有一个网卡工作

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了解决VM中配置多网卡多IP只能有一个网卡工作相关的知识,希望对你有一定的参考价值。

参考技术A VM Server 已经配置好了多个网卡,可以连接多个不同的IP段,但是创建的VM如果配置了多个网卡,只能有一个网卡连能ping通。

国内的百度搜了不少的答案根本没有用,Google到了这篇文章解决了我的问题:

https://stackoverflow.com/questions/14583984/multiple-ip-configuration-on-multiple-nic-on-same-server

简略说重点:

1) edit the file "/etc/sysctl.conf"

change the value from 1 to 2 in the following line:

net.ipv4.conf.default.rp_filter = 1

2)Add this line:

net.ipv4.conf.all.rp_filter = 2

After edit, it should look like this:

net.ipv4.conf.default.rp_filter = 2

net.ipv4.conf.all.rp_filter = 2

3)reload the configuration by typing

sysctl -p

Now you should be able to ping both IPs

以上是关于解决VM中配置多网卡多IP只能有一个网卡工作的主要内容,如果未能解决你的问题,请参考以下文章

Linux网卡多IP和bond实现多网卡使用同一IP

Jmeter 客户端多网卡问题

如何在VSphere中绑定多网卡?

多网卡 nacos服务为空

ubuntu 多网卡配置

Linux系统多网卡绑定实战。