KVM/桥:没有路由到主机 [英] KVM/Bridge: No Route To Host
问题描述
我已经在Fedora 17上使用KVM设置了VM,并为KVM配置了桥接网络.主机和VM都使用手动IP配置,主机的IP为192.168.0.2,VM的为192.168.0.10. 从VM可以毫无问题地连接到主机,但是即使可以从主机ping KVM,也不能从主机SSH到VM.尝试ssh只会给我结果没有路由到主机".
I've setup a VM on Fedora 17 with KVM and have configured a bridge network for the KVM. Both the host and the VM use manual IP configuration, with the host's IP as 192.168.0.2, the VM's 192.168.0.10. From the VM I can connect to the host without any problems, but from the host I can't SSH to the VM,even though I still can ping the KVM from the host. Trying to ssh just gives me the result "no route to host".
哦,我禁用了iptables,所以我不认为这是防火墙的问题.
Oh, I have iptables disabled so I don't think this is the problem of the firewall.
推荐答案
还要确保已为内核配置了IP转发:
Also ensure that the kernel is configure for ip forwarding:
$ sudo sysctl -a | grep net.ipv4.ip_forward
net.ipv4.ip_forward = 1
它的值应为1,而不是0.如果需要,请使用以下命令启用:
It should have a value of 1, not 0. If needed, enable with these commands:
echo "net.ipv4.ip_forward = 1" >> /etc/sysctl.conf
sudo sysctl -p /etc/sysctl.conf
这篇关于KVM/桥:没有路由到主机的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!