This question already has an answer here:
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) is
ifdown: 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.