Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I had many ip-s routed to my dedicated server. Interfaces file look like this

auto lo
iface lo inet loopback

auto eth0
iface eth0 inet static
address xx.xx.xx.xx
netmask 255.255.255.xx
gateway xx.xx.xx.xx

auto eth0:0
iface eth0:0 inet static
address xx.xx.xx.xx
netmask 255.255.255.xx

auto eth0:1
iface eth0:1 inet static
address xx.xx.xx.xx
netmask 255.255.255.xx

auto eth0:2
iface eth0:2 inet static
address xx.xx.xx.xx
netmask 255.255.255.xx

When I type in terminal /etc/init.d/networking restart I get this error many many times (I think this error is for every ip I try to assign)

RTNETLINK answers: No such process
SIOCSIFFLAGS: Cannot assign requested address

I have to wait some seconds and after that every thing works as I config, but how to free this error ?

Andrew

share|improve this question
add comment

1 Answer 1

You can try to assign multiple addresses to a single interface instead of using pseudo-interfaces. Like this:

auto eth0
iface eth0 inet static
address <ip1>
netmask <netmask1>
gateway <some_gateway>
up ip addr add <ip2>/<netmask2> dev eth0
up ip addr add <ip3>/<netmask3> dev eth0

etc.

Here <netmask2> and <netmask3> are in "number of 1s in binary" form. So for example the address 192.168.0.5/24 corresponds to 192.168.0.5 with netmask 255.255.255.0 because there are 24 1s in this network mask in binary format. Use http://jodies.de/ipcalc if in trouble.

share|improve this answer
    
is there a shortcut to assign a range of IPs ? –  Andrew Aug 1 '10 at 22:24
    
ip(8) manual page mentions the following syntax for specifying IP addresses: IFADDR := PREFIX | ADDR peer PREFIX [ broadcast ADDR ] [ anycast ADDR ] [ label STRING ] [ scope SCOPE-ID ] So you cannot specify an IP range. You can always write a shell script to generate /etc/network/interfaces file given a range of IP addresses if you really have that many. –  MasterM Aug 2 '10 at 8:07
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.