Tendo um problema com bridges no boot no servidor ubuntu 18.04

0

Estou tendo um problema com pontes no servidor ubuntu 18.04. Esta máquina tem dois NICs, e eu estou ligando a ponte a um deles, e conectando contêineres à ponte. Estou configurando serviços para o lan nos contêineres e usando IPs estáticos por meio da ponte para torná-los disponíveis para a sub-rede. No entanto, quando inicializo o sistema, não acabo recebendo um endereço IP na bridge:

br0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet6 fe80::7e8b:caff:fe03:57b0  prefixlen 64  scopeid 0x20<link>
        ether 7c:8b:ca:03:57:b0  txqueuelen 1000  (Ethernet)
        RX packets 167  bytes 19385 (19.3 KB)
        RX errors 0  dropped 50  overruns 0  frame 0
        TX packets 36  bytes 2946 (2.9 KB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

enp2s0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet6 fe80::7e8b:caff:fe03:57b0  prefixlen 64  scopeid 0x20<link>
        ether 7c:8b:ca:03:57:b0  txqueuelen 1000  (Ethernet)
        RX packets 758  bytes 637232 (637.2 KB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 433  bytes 33998 (33.9 KB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

enp3s0: flags=4099<UP,BROADCAST,MULTICAST>  mtu 1500
        ether 30:9c:23:41:a4:1b  txqueuelen 1000  (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

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 64  bytes 5104 (5.1 KB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 64  bytes 5104 (5.1 KB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

vethCHVFR2: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet6 fe80::fcf7:29ff:fe05:734b  prefixlen 64  scopeid 0x20<link>
        ether fe:f7:29:05:73:4b  txqueuelen 1000  (Ethernet)
        RX packets 348  bytes 26797 (26.7 KB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 422  bytes 350547 (350.5 KB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

vethLPOSTU: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet6 fe80::fcb3:33ff:fe5b:4bbb  prefixlen 64  scopeid 0x20<link>
        ether fe:b3:33:5b:4b:bb  txqueuelen 1000  (Ethernet)
        RX packets 49  bytes 4363 (4.3 KB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 172  bytes 279551 (279.5 KB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

Aqui está o meu arquivo / etc / network / interfaces no host global:

# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).

source /etc/network/interfaces.d/*

# The loopback network interface
auto lo
iface lo inet loopback


# The primary network interface
auto enp2s0
iface enp2s0 inet manual

auto enp3s0
iface enp3s0 inet manual
#  address 192.168.5.19
#  netmask 255.255.255.0
#  gateway 192.168.5.1
#  dns-nameserver 8.8.8.8
#


auto br0
iface br0 inet static
        bridge_ports enp2s0
        address 192.168.5.20
#        network 192.168.5.0
        netmask 255.255.255.0
        broadcast 192.168.5.255
        gateway 192.168.5.1
#        bridge_fd 9
#        bridge_hello 2
#        bridge_maxage 12
        bridge_stp off
        dns-nameserver 8.8.8.8
        dns-search XXX.network

O problema é que, quando eu emito uma "reinicialização da rede de serviços", acabo tendo todas as coisas juntas do jeito que deveria:

br0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet 192.168.5.20  netmask 255.255.255.0  broadcast 192.168.5.255
        inet6 fe80::7e8b:caff:fe03:57b0  prefixlen 64  scopeid 0x20<link>
        ether 7c:8b:ca:03:57:b0  txqueuelen 1000  (Ethernet)
        RX packets 122  bytes 12409 (12.4 KB)
        RX errors 0  dropped 21  overruns 0  frame 0
        TX packets 91  bytes 8072 (8.0 KB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

enp2s0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        ether 7c:8b:ca:03:57:b0  txqueuelen 1000  (Ethernet)
        RX packets 914  bytes 654161 (654.1 KB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 522  bytes 41870 (41.8 KB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

enp3s0: flags=4099<UP,BROADCAST,MULTICAST>  mtu 1500
        ether 30:9c:23:41:a4:1b  txqueuelen 1000  (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

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 64  bytes 5104 (5.1 KB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 64  bytes 5104 (5.1 KB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

vethCHVFR2: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet6 fe80::fcf7:29ff:fe05:734b  prefixlen 64  scopeid 0x20<link>
        ether fe:f7:29:05:73:4b  txqueuelen 1000  (Ethernet)
        RX packets 350  bytes 26933 (26.9 KB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 430  bytes 351218 (351.2 KB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

vethLPOSTU: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet6 fe80::fcb3:33ff:fe5b:4bbb  prefixlen 64  scopeid 0x20<link>
        ether fe:b3:33:5b:4b:bb  txqueuelen 1000  (Ethernet)
        RX packets 54  bytes 4625 (4.6 KB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 180  bytes 280218 (280.2 KB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

e tudo começa a funcionar como deveria. Alguma idéia de onde eu deveria olhar para que a rede comece corretamente em vez de precisar ser repassada para que a configuração seja feita?

Obrigado!

    
por stratvox 02.05.2018 / 16:32

1 resposta

0

Essa acabou sendo a interação entre ifupdown e netplan. Depois que eu configurei o netplan, o sistema surgiu como deveria. Suspeito que o problema ocorreu durante a inicialização, quando não foi possível atribuir um endereço à ponte, pois as partes principais do subsistema de rede ainda não estavam ativas. Eu expurgei o ifupdown e configurei o netplan e tudo começou a funcionar.

Obrigado @ chili555 por me apontar na direção certa.

    
por stratvox 28.05.2018 / 19:23