Ubuntu 18 with two network interfaces:
enp0s3: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 192.168.1.95 netmask 255.255.255.0 broadcast 192.168.1.255
enp0s8: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 192.168.99.95 netmask 255.255.255.0 broadcast 192.168.99.255
enp0s3 is bridge network, enp0s8 is host only.
$ sudo vi /etc/netplan/50-cloud-init.yaml
- to: 192.168.99.0/16
$ sudo netplan apply
There should be only one gateway.
Why two adapters for VM?
1. faster - traffic doesn't go through the router.
2. since it's not going through the router, even when your router is down or has a problem, you can still access VMs.