/srv/irclogs.ubuntu.com/2023/03/15/#netplan.txt

nikolamHi, can I have on the same interface, dhcp4 address and another sixed IP address? 10:38
nikolamfixed, sorry10:38
nikolamI would like to leave dhcp working but also add one more IP address to the same interface11:37
slyonnikolam: did you already try as described in this example (see "id0" interface)? https://netplan.readthedocs.io/en/stable/examples/#complex-example13:56
slyoni.e. defining "dhcp4: true" and "addresses: [...]"13:56
nikolamslyon, I tried adding addresses: under dhcp4: yes but it does not list second IP address on interface, after 'netplan try ' 15:09
nikolamPlus second address needs to be in different range. It works for another interface that has only static IPs15:10
nikolamWhat works is : ' sudo ip address add 10.0.4.15/24 dev ethernet1 'but I would like to have it in netplan. 15:23
slyonnikolam: what version of Netplan are you using (dpkg -l | grep netplan)?16:03
slyonIt seems to be working for me when using:16:04
slyonaddresses:16:04
slyon- "192.168.178.155/24"16:04
slyondhcp4: true16:04
slyonIt gives me a static IP and a dynamic/dhcp one:16:05
slyon$ ip addr show lan016:05
slyon88: lan0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UP group default qlen 100016:05
slyon    link/ether f8:e4:3b:2d:3b:b7 brd ff:ff:ff:ff:ff:ff16:05
slyon    inet 192.168.178.155/24 brd 192.168.178.255 scope global lan016:05
slyon       valid_lft forever preferred_lft forever16:05
slyon    inet 192.168.178.117/24 metric 100 brd 192.168.178.255 scope global secondary dynamic lan016:05
slyon       valid_lft 863984sec preferred_lft 863984sec16:05
slyonCould you share your explicit YAML configuration?16:05
nikolamslyon, Ubuntu 22.04 jammy , 5.15.0-67-generic #74-Ubuntu SMP, ii  libnetplan0:amd64  0.105-0ubuntu2~22.04.1 , ii  netplan.io 0.105-0ubuntu2~22.04.116:29
nikolamAha, so to try first addresses: and then dhcp4, in that order. Will try. 16:30
nikolamnope, does not apply addresses: IP , if DHCP is on.. at least here. Ok, will share slyon , https://bpa.st/SX4IS16:37
nikolamlabeling also didn't work.16:38
slyoninteresting... I've also tested on Jammy, using the networkd backend renderer. Could you please also share what is being generated in /run/systemd/network/10-netplan-eno1.network?16:42
slyonAnd maybe enable networkd debugging (https://gist.github.com/rkalkani/817edb3d335d7bc17857be81c746e9c9), re-execute "netplan apply" afterwards, and check journalctl -u systemd-networkd logs16:42
slyonto see what happens to the IP address16:42
slyonI wonder if dhcp4-overrides are somehow interfering here16:43
nikolamIgnore first 4 lines, I fixed copy/paste . https://bpa.st/7XK7A 17:33
nikolamThere's Virtualbox running on machine, too. One guest with bridged adapter on that interface (eno1) , second VM guest virtual adapter is on VBox intnet internal network, if that is of interest. 17:36

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