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

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

©著作权归作者所有,转载或内容合作请联系作者
【社区内容提示】社区部分内容疑似由AI辅助生成,浏览时请结合常识与多方信息审慎甄别。
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

相关阅读更多精彩内容

友情链接更多精彩内容