Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm trying to add multiple ip addresses to arch linux server.

Since I have only one network card with interface eth0 I think I need to add virtual interfaces like eth0:1 etc..

I have tried using this following syntax in /etc/rc.conf, but it seems to trow a bunch of errors: (note for this example I have omitted the ips for security)

eth0="eth0 x.x.x.x netmask x.x.x.x broadcast x.x.x.x"
eth0_0="eth0:0 x.x.x.x netmask x.x.x.x broadcast x.x.x.x"
INTERFACES=(lo eth0 eth0_0)
gateway="default gw x.x.x.x"

Any help would be appreciated. Thank you.

share|improve this question

Can you not use the ip command e.g.

ip addr add dev eth0

or whatever you need in a suitable init script ?

share|improve this answer

Basic IP Aliasing with netcfg

With netcfg, IP aliasing is managed by running the same ip commands you would use if you were doing it manually:

POST_UP='ip addr add dev eth0 label eth0:1'
PRE_DOWN='ip addr del dev eth0 label eth0:1'

That's it. It just works.

Here's a netcfg ethernet profile to start with:

DESCRIPTION='ifconfig like a boss'
DNS=('' '')

Now put that profile in a place like /etc/network.d/staminus. Let's test it.

netcfg staminus

If you still have any network configuration in rc.conf, remove it. It's deprecated. Just add net-profiles in your daemons list. We can tell netcfg to use this profile by default, when the system boots. In /etc/conf.d/netcfg:


Now append to your ethernet profile some POST_UP and PRE_DOWN commands as described earlier. Then stroke that glorious neckbeard.

share|improve this answer

Have a look at the archlinux wiki; it has a description of how to do this.

share|improve this answer
Yeah, already did. But I was trying to avoid using netcfg is there any other way to do this in rc.conf it self ? – Tux Jul 20 '12 at 7:59
Not that I know of, but I'm not an expert on archlinux. If you do find one, I'm sure they'd appreciate it if you update the wiki. It would have been very helpful if you included in your question that you'd already tried the recommended way - since you didn't, it looked as if you just didn't know it existed. – Jenny D Jul 20 '12 at 8:04
So far I only found references to netcfg but I'm trying to find a simpler way of doing this =) – Tux Jul 20 '12 at 8:19
Also, you can see the post on the forum, – Tux Jul 20 '12 at 8:24

Your Answer


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

Not the answer you're looking for? Browse other questions tagged or ask your own question.