Since you haven't provided the output of networkctl
, I'm going to assume this is a new install and wasn't upgraded from 17.04 or older.
You are looking to bridge eth0 and eth1. Netplan became the new default configuration utility in Ubuntu 17.10. Since you are using ubuntu-server, the renderer is systemd-networkd. For ubuntu-desktop the renderer is NetworkManager, which requires a GUI (but does have CLI binaries available).
The default config file is located in /etc/netplan/, and should have one of the following names:
- 00-installer-config.yaml
- 01-netcfg.yaml
- 01-network-manager-all.yaml
- 50-cloud-init.yaml
Make a backup so you can easily undo any changes, and then update your yaml file to look like this:
network:
version: 2
renderer: networkd
ethernets:
eth0:
dhcp4: no
dhcp6: no
eth1:
dhcp4: no
dhcp6: no
bridges:
br0:
dhcp4: yes
dhcp6: yes
interfaces: [eth0,eth1]
To apply changes, run sudo netplan apply
and check the status with networkctl
.
With this specific configuration, don't connect both ethernet ports into the same switch.
If you're more of a visual person, check out this YouTube video which shows pretty much what you're asking about but with more interfaces and a static IP instead of DHCP.
The bridge-utils package might need to be installed (sudo apt install bridge-utils
).