Score:0

ubuntu20.04 Multi-network port configration,router,netplan

gt flag

my ubuntu20.04 server have four network ports,I want my server to act as a router. If one network port is connected to the gateway, other devices can connect to the server through other network ports.

However, the IP addresses of these devices are assigned by the gateway.

This is the netplan configuration I wrote, but an error was thrown when using the netplan try command.

root@ubuntu-server:/etc/netplan# sudo netplan --debug try

ERROR:Error while loading /etc/netplan/eno1.yaml, aborting.

network:        
version: 2
renderer: networkd
ethernets: 
  eno1: {}
  enp1s0: {}
  enp2s0: {}
  enp4s0: {}
    addresses: 
      - 192.168.2.8/24
    gateway4: 192.168.2.1
    nameservers:
      addresses: [114.114.114.114,8.8.8.8]
bridges:
  br0:
    dhcp4: yes
    interfaces:
      - enp1s0
      - enp2s0
      - enp4s0

This is the network topology

This is the network topology.

paladin avatar
kr flag
What you want to create is not a router but a bridge. You configure all network interfaces to use automatic IP configuration, then you wait until one of your network interfaces has received a working IP configuration with gateway and etc., then you reconfigure that primary network device to act as bridge for the remaining network devices. Take a look here: [https://www.ubuntupit.com/how-to-configure-and-use-network-bridge-in-ubuntu-linux](https://www.ubuntupit.com/how-to-configure-and-use-network-bridge-in-ubuntu-linux)
I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.