4

I have a Debian 7 server and a usable IP address range from xx.xx.xx.90 to 93. While working on setting up the usable addresses via /etc/network/interfaces I have the following:

# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).

# The loopback network interface
auto lo
iface lo inet loopback

# The primary network interface
allow-hotplug eth0
iface eth0 inet static
        address xx.xx.xx.90
        netmask 255.255.255.248
        network xx.xx.xx.88
        broadcast xx.xx.xx.95
        gateway xx.xx.xx.89
        # Example extra IP comment 
        up   ip addr add xx.xx.xx.91/24 dev eth0 label eth0:0
        down ip addr del xx.xx.xx.91/24 dev eth0 label eth0:0
        # dns-* options are implemented by the resolvconf package, if installed
        dns-nameservers xx.xx.xx.xx xx.xx.xx.xx
        dns-search host.xx.xx

where the 2 lines below the 'Example extra IP comment' corresponds to the new IP I want to add(will be similar for the rest of the range).

When saving the above and restarting networking via sudo ifdown eth0 && sudo ifup eth0 I get the following message:

ifdown: interface eth0 not configured
RTNETLINK answers: File exists
Failed to bring up eth0.

I don't understand why it reports that eth0 is not configured and why it is not brought up.

Any help would be greatly appreciated.

UPDATE I used sudo ifdown --force eth0 && sudo ifup --force eth0 instead as suggested in comments by Zoredache and problem is resolved.

2
  • 1
    If you make a change to your interfaces file, while the link is up, you often need to pass the --force option to ifup/ifdown because your interfaces file will have irrelevant settings.
    – Zoredache
    Sep 28, 2013 at 0:23
  • Looks like you got it! Although I had used force in the past and was having the same problem, in this occasion it worked(when I tested it before I had a hostname problem so probably there was some complication, but forgot to test again after I fixed it). If you post this as an answer I'll accept it
    – gts
    Sep 28, 2013 at 9:16

4 Answers 4

4

You were assigned a /29 netblock, not a /24. But you specified /24 in your up and down scripts. Try fixing that first.

Better yet, use the new way (well, new in the last several releases) of specifying your addresses.

allow-hotplug eth0
iface eth0 inet static
        address xx.xx.xx.90
        netmask 255.255.255.248
        network xx.xx.xx.88
        broadcast xx.xx.xx.95
        gateway xx.xx.xx.89

iface eth0 inet static
        address xx.xx.xx.91
        netmask 255.255.255.248

iface eth0 inet static
        address xx.xx.xx.92
        netmask 255.255.255.248

iface eth0 inet static
        address xx.xx.xx.93
        netmask 255.255.255.248
1
  • Thanks, I did try both ways and the same problem persisted. As for /29 and /24 netblock, good point as well but did not help. Turns out that what was needed was --force in ifup and ifdown(answered in question comments)
    – gts
    Sep 28, 2013 at 9:18
0

It looks like your formatting is a little off. Try something like this:

auto eth0
iface eth0 inet static
address x.x.x.90

auto eth0:1
iface eth0:1 inet static
address x.x.x.91
0

If you want NetworkManager to handle interfaces that are enabled in /etc/network/interfaces: Set managed=true in /etc/NetworkManager/NetworkManager.conf.

Restart NetworkManager:

# /etc/init.d/network-manager restart

Then reboot

# reboot

source : https://wiki.debian.org/NetworkManager

-1
addresses 10.0.0.1/8 192.168.10.4/24

Use addresses for a range.

4
  • I don't see any mention of this in Debian's documentation. Where did you find it? Sep 27, 2013 at 22:52
  • In a Debian example
    – Jason
    Sep 28, 2013 at 0:42
  • Again, where did you find this? Sep 28, 2013 at 0:45
  • I'll have to find the link, but it was on this blog 1st on Google
    – Jason
    Sep 28, 2013 at 14:28

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .