/srv/irclogs.ubuntu.com/2021/03/10/#netplan.txt

ThomasConnectGood afternoon, I've got a query regarding some netplan behaviour. I'm running ubuntu 20.04 containers on lxc, with the standard cloud init netplan configuration, and I've noticed every time I do a netplan apply (not changing the config at all), my container gets assigned a new IP on the eth0 interface. Is this intended behaviour? and is it12:06
ThomasConnectpossible to avoid this happening?12:06
slyonThomasConnect: hmm I think this is the expected behavior (kind of). As the standard cloud-init netplan config probably defines a DHCP connection. And on 'netplan apply' the backend (systemd-networkd) is re-started, requesting a DHCP connection from the server.13:29
slyonUsually the DHCP should give the same IP address if a client with same MAC/existing lease is re-requesting a connection. So maybe this is a misconfiguration of the DHCP server?13:30
ThomasConnectI will look into the DHCP configuration we have, and see if there is something fishy. Thank you13:44
ThomasConnectWe have 2 dhcpd servers, a primary and a secondary, and it seems that the ip difference comes in between the primary and secondary. Makes sense because the container only ever gets 2 different ips, no matter how many times you do netplan apply13:56
slyonYes, that should explain the behaviour.13:59
BeRootsHello. I tried to make a netplan on eth0 to configure this interface to use a private ipv4 network between two computers using an rj45 crossover link (p2p without router ; hub ; switch ; ...). I tried a lot of things but my connection doesn't work yet. I have replace the content of /etc/netplan/50-cloudinit.yaml by this:14:12
BeRootshttps://pastebin.com/cTpGN2dU If someone have an idea about what's wrong here and why `ip a` not show any ipv4 for the eth0 interface?14:12
kjetilho/30 is very tight, but it should work I think.14:13
BeRootsIt is for a 2 machine network using a direct link (crossover).14:14
kjetilhoyes, so the other machine is .2, and .3 will be broadcast14:15
BeRootsYes14:15
kjetilhoshould work14:15
lukasmlooks good to me as well. It should show up in 'ip a' after you executed 'netplan apply'14:16
BeRootsWith only this yaml or with all uncommented lines ?14:17
lukasmleave out the comments. Just defining "addresses: " should be OK14:18
BeRootsOk. I tried with or without command then I do a `netplan generate && netplan -d apply && reboot` and I don't have any ip =L14:20
BeRootsI'm on an Ubuntu server (raspberry pi 4 release)14:21
lukasmcan you paste the output of 'ip a' and the output of 'netplan --debug apply'?14:21
BeRootsOk...14:22
BeRootsOk It's work. I have to plug the rj45 into the two computers. not only on the ubuntu. '=D14:34
BeRootsThanks for help (y)14:34
kjetilho:-D14:34
loco41211I have one interface with multiple public IPs. (ethernet interface in netplan yaml). What I want is to force a specific process via a specific source IP (shell script / curl / compiled code / whatever). Is the right approach here using ehternets -> xx -> addresses -> ip -> label ?23:30
kjetilhoin general the process should be configured to bind a specific address23:34
loco41211on the process level?23:35
loco41211I should specify I mean outgoing traffic, not incoming23:35
loco41211e.g HTTP requests23:35
kjetilhoyes23:36
loco41211I saw with physical network interfaces I can force a process via a specific namespace, via `ip netns` - any ideas if that wroks with virtual interfaces/labels config'd via netplan?23:36
kjetilhoI would use the vrf concept, but netplan doesn't support it, unfortunately.23:39
loco41211I don't mind other tools, nor creating other users if it's easier that way. Overall I just have multiple IPs on one eth interface, and I want to force specific processes to send their outgoing traffic via specific origin IPs... still researching, but if you have ideas or pointers (anyone else too), they're very appreciated23:40
kjetilholike I said, it's best to configure the daemon to use it23:41

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