I managed to make it work by putting both of configs in one file. When tried to generate the netplan config, this error appears.
Problem encountered while validating default route consistency.Please set up multiple routing tables and use `routing-policy` instead.
Error: Conflicting default route declarations for IPv4 (table: main, metric: default), first declared in enp0s25 but also in wlp3s0
From one of the comments here I went and added two properties metric
and optional
. metric
was used to solve the conflict of default routes whereas optional
is set to true so during boot we do not have to wait the network to come up.
I will not consider this as a final solution since it is done more like trial and error.
network:
version: 2
renderer: networkd
ethernets:
enp0s25:
dhcp4: false
dhcp6: false
optional: true
addresses:
- 192.168.80.111/24
routes:
- to: default
via: 192.168.80.1
metric: 100
nameservers:
addresses:
- 55.11.22.33
- 55.11.22.34
network:
version: 2
renderer: networkd
wifis:
wlp3s0:
dhcp4: false
dhcp6: false
optional: true
addresses: [192.168.80.111/24]
nameservers:
addresses: [192.168.80.1, 8.8.8.8]
access-points:
"wifi_conn":
password: "passconn"
routes:
- to: default
via: 192.168.80.32
metric: 200
#table: 100
Having said all of this I would not consider this as solved as there could be better solutions.