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

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

作者: 娄德晶 | 来源:发表于2020-07-29 16:10 被阅读0次

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只能有一个网卡工作

      本文链接:https://www.haomeiwen.com/subject/brtkrktx.html