/srv/irclogs.ubuntu.com/2020/11/04/#netplan.txt

timssI've been trying to configure a dual interfaced 18.04 server (Netplan 0.99), both with DHCP and a default GW. I'd like traffic that enters on a nic to leave on the same one. Adding `ip rule` and `ip route` to a new iproute2 table as shown here[1] works, but how would this translate to Netplan?14:41
timss[1]: https://unix.stackexchange.com/a/2334514:41
slyontimss: Right, you cannot define two default GW in netplan as there will be a conflict. So you need to define the static routes and routing policy manually, according to: https://netplan.io/reference/#routing14:45
slyonroutes = "ip route" / routing-policy = "ip rule"14:46
timssThat's helpful, thanks. If any routes are defined, are DHCP supplied DHCP default GW ignored for that given interface, or would you have to use dhcp4-overrides for that?14:51
slyonNo. You'd need dhcp4-overrides.use-routes=false as well.14:52
timssCheers, I'll have another go then14:52
slyonHave fun :)14:53
timssIn the stackexchange answer there's a default gw added to the isp2 rt_table (ip route), how should the routes section look to do the same? I don't necessarily know what subnets the incoming packets are coming from as they are not on this LAN15:08
slyonI think you should be able to use 0.0.0.0/0 as the default subnet15:31
mike40303hello - I have an instance in google cloud that needs a route on the 2nd nic.   I have the yaml file in /etc/netplan modified so that it adds the routes when I run a netplan apply but the route is not there on boot.  No errors when I run the netplan apply and the route is added, but I need the route on boot to mount vi fstab.  Any suggestions on15:58
mike40303how to troubleshoot?15:58
slyonmike40303: do you have DHCP enabled? maybe you need dhcp4-overrides.use-routes=false?16:05
mike40303I will try that, but I did set the IP static as /32 but then I added the two routes that are present on the first nic:  to:   10.150.0.1  via 0.0.0.0   and  to 10.106.0.0/24  via 10.150.0.1.   When I run the netplan apply I see "ens5: Configured" in the area I was having issues before I got the routes correct.16:10
mike40303any time I use dhcp I get ens5: Could not set route: Network is unreachable.  If I set the IP static the same routes do not show an error when netplan apply is ran.16:58
slyonmike40303: where do you get this error message, i.e. running which command?17:01
slyonalso, the route is still there in your /etc/netplan/*.yaml file after reboot, correct? And if you run 'netplan apply' after reboot the route is working again?17:01
mike40303when I run netplan apply I see the ens5: Confirgured or the Network in unreachable on the serial console.  yes, the route is still in the yaml file but not in the routing table on a reboot.   If I run netplan apply the route is then in netstat -nr.17:09
slyonwhat version of netplan and operating system are you using?17:10
mike403031.10.1-5build1 on ubuntu 18.0417:11
slyon1.10.1-5build1 seems to be the "netplan" deb (unrelated to the netplan.io project), could you check for "netplan.io"?17:12
mike40303sorry, 0.99-0ubuntu3~18.04.317:13
slyonok. that should be alright17:14
slyoncould you share your YAML config, e.g. via paste.ubuntu.com?17:16
slyonsorry... I need to run.17:23
mike40303thank you, here it is https://paste.ubuntu.com/p/TKM6ZYJkCH/17:29
mike40303dhclient was running and wiping out the netplan config.    we got it running by adding the /etc/dhcp/dhclient-exit-hooks.d/systemd-networkd script mentioned here in update #319:37
mike40303https://serverfault.com/questions/1007936/stop-google-compute-instance-from-configuring-second-network-interfacehttps://serverfault.com/questions/1007936/stop-google-compute-instance-from-configuring-second-network-interface19:37
=== JanC_ is now known as JanC

Generated by irclog2html.py 2.7 by Marius Gedminas - find it at mg.pov.lt!