No Ubuntu 16.04, meu /etc/network/interfaces
arquivo fica assim:
auto lo
iface lo inet loopback
auto br0
iface br0 inet static
address 144.76.AAA.BBB
netmask 255.255.255.224
gateway 144.76.CCC.DDD
bridge_ports eth0
Como isso se traduziria em uma networkd
configuração no Ubuntu 18.04? Foi o que tentei, sem sucesso (depois de reiniciar, não consigo mais acessar a máquina):
/etc/systemd/network/01-br0.netdev
:
[NetDev]
Name=br0
Kind=bridge
/etc/systemd/network/01-br0.network
:
[Match]
Name=br0
[Network]
Address=144.76.AAA.BBB/29
Gateway=144.76.CCC.DDD
/etc/systemd/network/10-enp4s0.network
:
[Match]
Name=enp4s0
[Network]
Bridge=br0
Esta é a saída em /var/log/syslog
:
Jun 2 13:30:51 master systemd-networkd[616]: br0: netdev ready
Jun 2 13:30:51 master systemd-networkd[616]: Enumeration completed
Jun 2 13:30:51 master systemd-networkd[616]: lo: Link is not managed by us
Jun 2 13:30:51 master systemd-networkd[616]: enp4s0: Link is not managed by us
Jun 2 13:30:51 master systemd-networkd[616]: br0: IPv6 successfully enabled
Jun 2 13:30:51 master systemd-networkd[616]: lo: Link is not managed by us
Jun 2 13:30:51 master systemd-networkd[616]: enp4s0: IPv6 successfully disabled
Jun 2 13:30:51 master systemd[1]: Starting Dispatcher daemon for systemd-networkd...
Jun 2 13:30:52 master networkd-dispatcher[749]: No valid path found for iwconfig
Jun 2 13:30:52 master systemd[1]: Started Dispatcher daemon for systemd-networkd.
Jun 2 13:30:53 master systemd-networkd[616]: enp4s0: Gained carrier
Jun 2 13:30:53 master systemd-networkd[616]: enp4s0: Configured
Jun 2 13:30:53 master systemd-networkd[616]: br0: Gained carrier
Jun 2 13:30:53 master systemd-networkd[616]: br0: Gained IPv6LL
Jun 2 13:30:53 master systemd-networkd[616]: br0: Configured
Jun 2 13:30:53 master systemd-networkd-wait-online[661]: managing: br0
Jun 2 13:30:53 master systemd-networkd-wait-online[661]: managing: enp4s0
Jun 2 13:30:53 master systemd-networkd-wait-online[661]: ignoring: lo
Responder1
A resposta a seguir foi copiada e colada de uma atualização ainda a ser publicada noGuia do servidor Ubuntu:
Configure a ponte editando a configuração do netplan encontrada em /etc/netplan/:
network:
version: 2
renderer: networkd
bridges:
br0:
dhcp4: yes
interfaces:
- enp3s0
Insira os valores apropriados para sua interface física e rede. Agora aplique a configuração para habilitar a ponte:
sudo netplan apply
A nova interface de ponte agora deve estar instalada e funcionando. O brctl fornece informações úteis sobre o estado da ponte, controla quais interfaces fazem parte da ponte, etc. Consulte man brctl para obter mais informações.
Há um exemplo estáticoaqui.