ifdown interface not configured (Debian 6)
ifdown thinks the interface is already down. If that's not true, because it was brought up using some command other than ifup (ifconfig for example) then you need to shut it down the same way (ifconfig eth0 down
).
If the ip addr add
commands have also been done manually, you may have to undo them with ip addr del
.
ifup and ifdown are fragile. They don't operate smoothly if they aren't the only configuration tools being used. They could get current interface status from the kernel instead of remembering what they last changed it to, but they don't.
Once you've made the current state of the interface match what ifupdown thinks it is, they will start behaving better.
Related videos on Youtube
Marco Alka
Updated on September 18, 2022Comments
-
Marco Alka over 1 year
My server is dedicated (non-virtual). I want to have 3+1 static IPs. I used aliases (eth0:0, eth0:1) previously, but read that this method is deprecated. So I added another IP and reconfigured my interface with ifup/ifdown while I'm at i;, but ifdown tells me that the interface is not configured.
/etc/network/interfaces looks like this:
auto lo eth0 iface lo inet loopback # Main IPs (IPv4 + IPv6) allow-hotplug eth0 iface eth0 inet static address 81.x.x.x netmask 255.255.255.0 broadcast 81.x.x.255 gateway 81.x.x.1 iface eth0 inet6 static address 2a02:x:x:x::x:x netmask 64 gateway 2a02:x:x:x::1 # 2nd IP up ip addr add 81.x.x.x/32 dev eth0 # 3rd IP up ip addr add 81.x.x.x/32 dev eth0
Note that the 2nd and 3rd IP adresses are from different net ranges (don't know if it matters)
I reload the network configuration with
nohup sh -c "ifdown eth0 && ifup eth0"
The exact output (nohup) isifdown: interface eth0 not configured SIOCADDRT: File exists Failed to bring up eth0.
What am I doing wrong?
Edit: This questuion has been asked before. But the old question uses deprecated methods. Also the solution does not work for me. Since people here at serverfault seem not to be able to help me but rather just close this as duplicate (I doubt you have actually read what I wrote...) I have asked people at official forums. They are stuck with this problem and cannot find a solution at all - but at least try.
I am getting more and more problems, so I will reinstall the server. You can leave this question closed and unanswered.-
Marco Alka over 10 yearsnope, that did not solve my problem.
networking restart
works incorrectly without giving an error an is also DEPRECATED. -
Dave M over 10 yearsIf you simply added the part of your edit about deprecated methods and that even that method did not work may have made this a candidate for a re-open. It also can take more than a few days to get an answer.
-
zaqxen about 10 yearsI agree with @MarcoAlka, the problem is not solved and I also can't find a solution for this problem. I have a feeling that
ifup
,ifdown
and/etc/init.d/networking restart
are all deprecated but no one wants to tell us the new way. -
Marco Alka about 10 years@EthanLeroy: unfortunately, I cannot test a solution any more. I switched over to FreeBSD as this question took too long and no one was able to find a solution. Imho, FreeBSD is a lot easier to configure. Took me way to long to find this out, though.
-
appas about 9 yearsYou can try
sudo ip link set eth0 down
andsudo ip link set eth0 up
.
-
-
Marco Alka over 10 yearsnohup contains
SIOCSIFADDR: Permission denied Failed to bring up eth0
after I tried ifconfig eth0 down instead of ifdown -
Admin over 10 yearswhy is nohup involved in this anyway?
-
Marco Alka over 10 yearsbecause I want to have the output in a text file since I am connected via SSH.