Need help with static routes in new netplan config. Have ubuntu server 18.04 with 2 network interfaces, ethernet and wlan. After successful basic configuring in /etc/netplan/50-cloud-init.yaml i has both networks. But enp3s0 is intranet, wlp2s0 is wifi router. And i cant make internet over wifi. After few days configuring/reconfiguring Yaml file I cant get it to work.
Only deleting default gateway /sbin/route del default gw 10.185.0.1 works, but than no routing to intranet. Route -n list
How add this routes i has no idea...
network:
version: 2
renderer: networkd
ethernets:
enp3s0:
addresses: []
dhcp4: true
gateway4: 10.185.0.1
nameservers:
addresses: [10.185.x.x, y.y.y.y]
routes:
- to: 10.185.0.0/0
via: 10.185.0.1
metric: 100
table: 101
routing-policy:
- from: 10.185.0.0/24
table: 101
wifis:
wlp2s0:
addresses: []
dhcp4: true
optional: true
gateway4: 192.168.8.1
access-points:
"Wifi":
password: "password"
nameservers:
addresses: [8.8.8.8,8.8.4.4]
routes:
- to: 0.0.0.0/0
via: 192.168.8.1
metric: 90
table: 91
routing-policy:
- from: 192.168.8.0/24
table: 91
UPD:
Override config /etc/systemd/network/. Using UseRoutes=false cause infinite network search at boot, setting RouteMetric=700 works better, got internet over wifi after boot! But adding new route like: 10.180.0.0/16 via 10.185.0.1 cause not effect, not appear in route kernel routing table.
And i still misunderstand why tracerout 172.16.185.194 go through 192.168.8.1. I read about ip4 table, but - to: 172.16.0.0/12 or /16 doesn`t works.