VM Server 已经配置好了多个网卡,可以连接多个不同的IP段,但是创建的VM如果配置了多个网卡,只能有一个网卡连能ping通。
国内的百度搜了不少的答案根本没有用,Google到了这篇文章解决了我的问题:
简略说重点:
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
网友评论