/srv/irclogs.ubuntu.com/2021/11/23/#netplan.txt

SteelRoseHello all! I am having some issues with netplan when adding a second NIC. I created this https://pastebin.com/EFNyR4ka to describe the problem. Your help is appreciated! Thanks! 07:57
schopinSteelRose: hi! In your pastebin you mention wanting to connect on a different VLAN? I don't see any mention of vlan in your config file.08:28
SteelRoseschopin: let me rephrase it: I need to have 1 NIC on one network with its own GW, and 1 NIC on another network with its own GW08:36
schopinAh. OK.08:37
SteelRoseI found this example https://netplan.io/examples/#using-multiple-addresses-with-multiple-gateways - it is OK if I have 1 NIC with 2 IP addresses but now I cannot reach the server using the secondary IP ... 08:37
SteelRosehaving 2 IP addresses on one NIC is now what I was hoping for but it will do for now.. 08:38
schopinSteelRose: sorry if this seems obvious, but have you invoked `netplan try` or `netplan apply`?08:38
SteelRoseschopin: yes :-) 08:38
SteelRosenetplan create first, then apply 08:39
SteelRoseafter the apply is when I loose connectivity with the server (my ssh session freezes right away) 08:39
SteelRoseso my question to the channel: do you guys have a working example of 2 NICs, each with a different IP + gateway for each range? 08:40
kjetilhoSteelRose: are you sure you need multiple gateways?08:41
schopinSteelRose: multiple gateways don't make sense on a system level.08:41
schopinRecent versions of netplan should actually emit a warning if multiple gateways are configured.08:41
schopinAlso, could you paste the content of /run/systemd/network/*netplan-* after running `netplan apply`? This is where netplan puts the generated systemd-networkd configuration files.08:43
schopin... wait, I just noticed you used different routing tables. Disregard my gateway comment then :)08:44
SteelRoseOK; I need to rephrase again: "different IPs + routing for each range" :-) 08:45
schopinEh. It's morning where I am, coffee hasn't kicked in yet ;-)08:46
SteelRoseschopin: it's morning here as well 08:47
schopinAlso, it would be nice to have whatever netplan outputs (if anything), as well as the output of `ip l` and `ip a`?08:47
schopinI'm not down on the troubleshooting routines of netplan yet :P08:48
schopinOh, and perhaps simply `netplan get`. This last one dumps all the config that netplan sees.08:49
SteelRoseschopin: I modified the netplan following the official example  https://netplan.io/examples/#using-multiple-addresses-with-multiple-gateways - but now I cannot ping the secondary IP 08:52
schopinThe problem can be in a lot of places, from netplan failing to find the updated config, to it failing to generate the correct config for systemd-networkd, to networkd failing to configure the interface, or the routes... Hence my different questions :)08:54
SteelRosethanks schopin ... I'll review every step and might come back with some updates09:20
SteelRosere09:20
kjetilhoSteelRose: in my experience, policy routing is required when you have different subnets behind different interfaces10:03
kjetilhoso the example doc you linked isn't relevant for you, I think10:04
SteelRosekjetilho: do you have any working example? 10:04
kjetilho(and sorry, I didn't look at your pastebin earlier, I underestimated your understanding :)10:04
SteelRose:-) 10:04
kjetilhoSteelRose: in my working config, I have from: nic-local-address on each route10:06
kjetilhoand also the I use that nic-local-address in my routing-policy, but that shouldn't matter I think10:07
kjetilhooh, and I don't have a gateway set on the secondary NIC10:07
kjetilho*and* I have `link-local: [ ]`10:08
SteelRosekjetilho: would you mind sharing your config? of course, I expect that you fake the addresses :-) 10:32
kjetilhoso much work to fake addresses consistently :)10:33
kjetilhothe above is a pretty accurate diff10:33
SteelRose:-/ 10:39
kjetilhoSteelRose: oh, another difference: I just use plain gateway4 on ens160.12:18
SteelRosekjetilho: that is what I had... anyway, I had to put that netplan config on ice as something more important landed on my desk 13:52

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