multiple NICs under ubuntu 18.04
How to translate what we had to do to have 2 independent stream of traffic on 2 or more NIC interfaces with the new netplan.io + systemd-networkd?
auto ens2
iface ens2 inet static
address 192.168.5.100
netmask 255.255.255.0
gateway 192.168.5.1
dns-nameservers 1.1.1.1
auto ens3
iface ens3 inet static
address 192.168.3.15
netmask 255.255.255.0
up ip route add default table 102 dev ens3 via 192.168.3.1
up ip rule add from 192.168.3.0/24 lookup 102
down ip rule del from 192.168.3.0/24
down ip route del default table 102 via 192.168.3.1
network:
version: 2
renderer: networkd
ethernets:
ens3:
addresses: [192.168.3.15/24]
dhcp4: no
routes:
- to: 0.0.0.0/0
via: 192.168.3.1
metric: 100
table: 101
routing-policy:
- from: 192.168.3.0/24
table: 101
ens2:
addresses: [192.168.5.100/24]
dhcp4: no
gateway4: 192.168.5.1
nameservers:
addresses: [1.1.1.1]
This has been confirmed by 'cyphermox' on IRC, lead developer on netplan.io.
Check with ip route
and ip rule
if systemd
has created everything needed and if not restart it -> sudo service systemd-networkd restart