kvm虚拟机网络

现状

一台安装Centos 7的惠普服务器,安装KVM虚拟化平台,KVM平台中有数台虚拟机。
需要自己的window电脑连接KVM平台中的虚拟机

  • 服务器
    • eno1:192.168.0.194
    • virbr0:192.168.122.1
  • window
    • 192.168.0.218
  • kvm平台中的某台虚拟机IP
    • eth0:192.168.122.2


      kvm虚拟机网络_第1张图片
      拓扑图

windows系统操作

由于路由器没办法得到,导致只能在windows添加路由暂时操作。

route -p add 192.168.122.0 MASK 255.255.255.0  192.168.0.194 

linux中的操作

iptables -F
iptables -P INPUT ACCEPT
iptables -P FORWARD ACCEPT
iptables -P OUTPUT ACCEPT
iptables -t nat -A POSTROUTING -s 192.168.1.0/24 -o eno1 -j SNAT --to-source 192.168.122.1
iptables -t nat -A POSTROUTING -s 192.168.122.0/24 -j MASQUERADE

你可能感兴趣的:(kvm虚拟机网络)