Sample Header Ad - 728x90

ifdown: interface end0 not configured. RTNETLINK answers: File exists. ifup: interface end0 already configured when setting static and DHCP interface

0 votes
1 answer
404 views
In a device with Debian BookWorm 12.5, I want to enable and disable a static IP using a Node application at runtime. The /etc/network/interfaces is the following : auto lo iface lo inet loopback ifconfig gives the following output : ~# ifconfig end0: flags=4163 mtu 1500 inet 192.168.109.176 netmask 255.255.255.0 broadcast 192.168.109.255 inet6 fe80::7376:77ae:719e:249f prefixlen 64 scopeid 0x20 ether f8:dc:7a:3e:8d:bb txqueuelen 1000 (Ethernet) RX packets 1155 bytes 392299 (383.1 KiB) RX errors 0 dropped 0 overruns 0 frame 0 TX packets 519 bytes 84713 (82.7 KiB) TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0 lo: flags=73 mtu 65536 inet 127.0.0.1 netmask 255.0.0.0 inet6 ::1 prefixlen 128 scopeid 0x10 loop txqueuelen 1 (Local Loopback) RX packets 344 bytes 23930 (23.3 KiB) RX errors 0 dropped 0 overruns 0 frame 0 TX packets 344 bytes 23930 (23.3 KiB) TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0 Trying to turn-down the end0 interface, I get the following : ~# ifdown end0 ifdown: interface end0 not configured Then, I modify the /etc/network/interfaces as following : auto lo iface lo inet loopback auto end0 iface end0 inet static address 192.168.0.15 netmask 255.255.255.0 gateway 192.168.109.254 Trying to turn-up the interface with ifup end0, I get no error but the ifconfig output is the same as before. Trying again with ifup, I get the following : ~# ifup end0 ifup: interface end0 already configured and ifconfig gives the same output as before. I tried also to mess things up using ifconfig end0 down, service NetworkManager restart and service networking restart , but I continue to get undetermined behaviour, specially if I try to turn it down and up again when changing the interfaces file rolling back to dhcp configuration (i.e. without any reference to end0). What am i missing?
Asked by M.Liscio (230 rep)
Jun 27, 2024, 07:09 PM