virt-manager (qemu) não pode fazer o NAT funcionar

0

Não consigo obter o NAT padrão para funcionar. Não atribui um IP (DHCP) ao convidado (centos) usando a rede. Pelo que posso dizer, a rede está funcionando.

Se eu usar a rede macvtap que se conecta com o físico, posso obter uma conexão com a Internet sem problemas. Qual resolve 1/2 meu problema, o outro 1/2 é que eu também quero ter host < - > comunicação com os hóspedes também.

Antergos Linux 4.18.9-arch1-1-vfio

brctl show :

bridge name bridge id       STP enabled interfaces
docker0     8000.0242e1374032   no      
virbr0      8000.5254004bc729   yes     virbr0-nic

sudo virsh net-list :

 Name      State    Autostart   Persistent  
--------------------------------------------
 default   active   yes         yes      

ip addr :

1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    inet 127.0.0.1/8 scope host lo
       valid_lft forever preferred_lft forever
    inet6 ::1/128 scope host 
       valid_lft forever preferred_lft forever
2: enp6s0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP group default qlen 1000
    link/ether 70:85:c2:45:d7:bf brd ff:ff:ff:ff:ff:ff
    inet 192.168.1.6/24 brd 192.168.1.255 scope global dynamic noprefixroute enp6s0
       valid_lft 67028sec preferred_lft 67028sec
    inet6 fe80::f327:61da:4f77:d716/64 scope link noprefixroute 
       valid_lft forever preferred_lft forever
5: docker0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc noqueue state DOWN group default 
    link/ether 02:42:e1:37:40:32 brd ff:ff:ff:ff:ff:ff
    inet 172.17.0.1/16 brd 172.17.255.255 scope global docker0
       valid_lft forever preferred_lft forever
31: virbr0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP group default qlen 1000
    link/ether 52:54:00:4b:c7:29 brd ff:ff:ff:ff:ff:ff
    inet 192.168.100.1/24 brd 192.168.100.255 scope global virbr0
       valid_lft forever preferred_lft forever
32: virbr0-nic: <BROADCAST,MULTICAST> mtu 1500 qdisc fq_codel master virbr0 state DOWN group default qlen 1000
    link/ether 52:54:00:4b:c7:29 brd ff:ff:ff:ff:ff:ff
34: vnet0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel master virbr0 state UNKNOWN group default qlen 1000
    link/ether fe:54:00:2d:44:ab brd ff:ff:ff:ff:ff:ff
    inet6 fe80::fc54:ff:fe2d:44ab/64 scope link 
       valid_lft forever preferred_lft forever

ifconfig :

docker0: flags=4099<UP,BROADCAST,MULTICAST>  mtu 1500
        inet 172.17.0.1  netmask 255.255.0.0  broadcast 172.17.255.255
        ether 02:42:e1:37:40:32  txqueuelen 0  (Ethernet)
        RX packets 0  bytes 0 (0.0 B)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 0  bytes 0 (0.0 B)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

enp6s0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet 192.168.1.6  netmask 255.255.255.0  broadcast 192.168.1.255
        inet6 fe80::f327:61da:4f77:d716  prefixlen 64  scopeid 0x20<link>
        ether 70:85:c2:45:d7:bf  txqueuelen 1000  (Ethernet)
        RX packets 3052971  bytes 4501201281 (4.1 GiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 1011201  bytes 125025258 (119.2 MiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0
        device memory 0xfe500000-fe51ffff  

lo: flags=73<UP,LOOPBACK,RUNNING>  mtu 65536
        inet 127.0.0.1  netmask 255.0.0.0
        inet6 ::1  prefixlen 128  scopeid 0x10<host>
        loop  txqueuelen 1000  (Local Loopback)
        RX packets 88398  bytes 5896464 (5.6 MiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 88398  bytes 5896464 (5.6 MiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

virbr0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet 192.168.100.1  netmask 255.255.255.0  broadcast 192.168.100.255
        ether 52:54:00:4b:c7:29  txqueuelen 1000  (Ethernet)
        RX packets 216  bytes 32270 (31.5 KiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 6  bytes 252 (252.0 B)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

vnet0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet6 fe80::fc54:ff:fe2d:44ab  prefixlen 64  scopeid 0x20<link>
        ether fe:54:00:2d:44:ab  txqueuelen 1000  (Ethernet)
        RX packets 26  bytes 4778 (4.6 KiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 183  bytes 11380 (11.1 KiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

xml padrão ( sudo virsh net-edit default ):

<network>
  <name>default</name>
  <uuid>a755b367-26bf-4282-993e-f8404aee3a89</uuid>
  <forward mode='nat' />
  <bridge name='virbr0' stp='on' delay='0' />
  <mac address='52:54:00:4b:c7:29' />
  <domain name='default />
  <ip address='192.168.100.1' netmask='255.255.255.0'>
    <dchp>
      <range start='192.168.100.128' end='192.168.100.254' />
    </dchp>
  </ip>
</network>

/ect/firewalld/firewalld.conf :

DefaultZone=public
MinimalMark=100
CleanupOnExit=yes
Lockdown=no
IPv6_rpfilter=yes
IndividualCalls=no
LogDenied=off
AutomaticHelpers=system
FirewallBackend=nftables

firewall-cmd --list-all :

public (active)
  target: default
  icmp-block-inversion: no
  interfaces: docker0 enp6s0
  sources: 
  services: dhcpv6-client ssh
  ports: 
  protocols: 
  masquerade: no
  forward-ports: 
  source-ports: 
  icmp-blocks: 
  rich rules: 

Dentro da VM (centos)

ip addr :

1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN qlen 1
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    inet 127.0.0.1/8 scope host lo
       valid_lft forever preferred_lft forever
    inet6 ::1/128 scope host 
       valid_lft forever preferred_lft forever
2: ens1: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP qlen 1000
    link/ether 52:54:00:26:1e:dc brd ff:ff:ff:ff:ff:ff
3: virbr0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc noqueue state DOWN qlen 1000
    link/ether 52:54:00:e9:bf:f0 brd ff:ff:ff:ff:ff:ff
    inet 192.168.122.1/24 brd 192.168.122.255 scope global virbr0
       valid_lft forever preferred_lft forever
4: virbr0-nic: <BROADCAST,MULTICAST> mtu 1500 qdisc pfifo_fast master virbr0 state DOWN qlen 1000
    link/ether 52:54:00:e9:bf:f0 brd ff:ff:ff:ff:ff:ff
    
por Drew 30.10.2018 / 22:55

0 respostas