Estou no Centos 7 com o KVM e virt-manager instalados. Eu tenho uma máquina virtual (guest) com o Debian 8.1 nela. Rede no convidado foi configurada com virt-manages usando NAT (com configurações padrão). Então agora minha máquina virtual tem acesso à Internet e IP local 192.168.122.227.
No meu sistema host eu tenho 1 interface de rede física e 1 ip público principal e 3 adicionais ips públicos nele.
Meus ips públicos (exemplo): 85.0.0.1, 85.0.0.2, 85.0.0.3, 85.0.0.4
Broadcast ips também são exemplos.
Meu ifconfig do host:
enp2s0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 85.0.0.1 netmask 255.255.255.192 broadcast 85.0.0.127
ether d4:3d:7e:ec:b3:55 txqueuelen 1000 (Ethernet)
RX packets 4920 bytes 416179 (406.4 KiB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 2298 bytes 392837 (383.6 KiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
enp2s0:0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 85.0.0.2 netmask 255.255.255.192 broadcast 85.0.0.127
ether d4:3d:7e:ec:b3:55 txqueuelen 1000 (Ethernet)
enp2s0:1: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 85.0.0.3 netmask 255.255.255.192 broadcast 85.0.0.127
ether d4:3d:7e:ec:b3:55 txqueuelen 1000 (Ethernet)
enp2s0:2: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 85.0.0.4 netmask 255.255.255.192 broadcast 85.0.0.127
ether d4:3d:7e:ec:b3:55 txqueuelen 1000 (Ethernet)
lo: flags=73<UP,LOOPBACK,RUNNING> mtu 65536
inet 127.0.0.1 netmask 255.0.0.0
loop txqueuelen 0 (Local Loopback)
RX packets 30 bytes 2856 (2.7 KiB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 30 bytes 2856 (2.7 KiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
virbr0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 192.168.122.1 netmask 255.255.255.0 broadcast 192.168.122.255
ether 52:54:00:cf:32:9d txqueuelen 0 (Ethernet)
RX packets 18 bytes 1407 (1.3 KiB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 8 bytes 779 (779.0 B)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
vnet0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
ether fe:54:00:96:2d:23 txqueuelen 500 (Ethernet)
RX packets 18 bytes 1659 (1.6 KiB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 574 bytes 30211 (29.5 KiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
Quando faço isso na máquina host, continuo chegando ao computador host pelo ssh 85.0.0.2, mas não para o convidado:
iptables -t nat -I PREROUTING -d 85.0.0.2 -i enp2s0:0 -j DNAT --to-destination 192.168.122.227
iptables -t nat -I POSTROUTING -s 192.168.122.227 -o enp2s0:0 -j SNAT --to-source 85.0.0.2 iptables -P FORWARD ACCEPT
iptables -P FORWARD ACCEPT
Minha configuração enp2s0: 0:
# Generated by parse-kickstart
UUID=9928e0a6-df18-45ef-a826-edaf8b4dc370
DNS2=85.0.0.10 #(example)
DNS1=85.0.0.10 #(example)
BOOTPROTO=none
DEVICE=enp2s0:0
ONBOOT=yes
IPV6INIT="no"
TYPE=Ethernet
IPADDR=85.0.0.2
PREFIX=26
GATEWAY=85.0.0.127
DEFROUTE=yes
IPV4_FAILURE_FATAL=no
IPV6_AUTOCONF=yes
IPV6_DEFROUTE=yes
IPV6_PEERDNS=yes
IPV6_PEERROUTES=yes
IPV6_FAILURE_FATAL=no
NAME="System enp2s0:0"
Eu não estou estupidamente duplicando pergunta, eu já li e pesquisei muito, mas ainda não consigo resolver este problema. Por favor ajude!