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

I have an interesting conundrum: I've just finished added a second static IP address to my CentOS 6.x system, but only 1 of the interfaces (the original, the first) is coming up. The new one isn't coming up on boot.

However, the second int DOES come up after running: ifup eth0:0

Both interfaces are setup manually, and are configured to come up on boot:

[root@myers network-scripts]# cat ifcfg-eth0

    ####
    # eth0 default configuration
    #

    DEVICE="eth0:0"
    BOOTPROTO="none"
    IPV6INIT="no"
    IPV6_AUTOCONF="no"
    ONBOOT="yes"
    TYPE="Ethernet"
    NETMASK=255.255.255.0
    IPADDR=50.116.63.90
    GATEWAY=50.116.63.1

And the second:

[root@myers network-scripts]# cat ifcfg-eth0:1
DEVICE="eth0:1"
BOOTPROTO="none"
ONPARENT="yes"
NETMASK=255.255.255.0
IPADDR=23.239.10.173

Finally, in the second IP address (the new one), I've tried changing the device name from eth0:1 to eth0:0, but that doesn't work either.

What am I missing?

share|improve this question
    
Hi David, Do you have 2 physical network cards, or just one and you try to create an alias ? Also, what is dmesg saying after a reboot, about the interface that won't go up. –  MTIhai Mar 26 at 15:56
    
This is a virtual machine (VPS), so it only has 1 physical connection. I'll check on dmesg, but don't want to take the server down during biz hours - will try to get to it tonight. –  David W Mar 28 at 14:43
    
I ran "dmesg > boot.dmesg" and checked the contents of the file, and don't see anything regarding either of the interfaces. I've grepped and searched for eth0, eth0:0, and ifup, and more... I'm not too familiar with what I'm looking for in the dmesg output, though. –  David W Mar 29 at 0:47

3 Answers 3

up vote 1 down vote accepted

Doesn't eth0:0 have to be eth0 to be considered the parent of eth0:1 (which should be eth0:0... I don't know what happens if you SKIP a virtual device ID) for ONPARENT to work?

share|improve this answer
    
Well, originally I had it set to ONBOOT, and then edited the question today to reflect current settings. I should've made that clear in the updated question. I think you're right though - it should be ONBOOT, and not ONPARENT. However, I found the ONPARENT reference on a Linode Multiple Static IP networking guide... –  David W Mar 29 at 17:53
    
That's odd, ONBOOT should pretty much work regardless... –  StrangeWill Mar 29 at 17:54
1  
BTW.... I thought I recognized your avatar! :P –  David W Mar 29 at 17:57
1  
Your answer helped me find the root issue, in a round-about way. It's fixed now. The solution: Rename the device / interface on the first IP address from "eth0:0" TO "eth0", and then ensure the second device is named "eth0:0". –  David W Mar 29 at 18:14

You can only have one default gateway defined on a system. Remove the GATEWAY line from ifcfg-eth0:0.

share|improve this answer
    
Good call. Unfortunately, making that change from ifcfg-eth0:0 didn't solve the root issue (although ifcfg-eth0 still works, and ifcfg-eth0:0 still works whenever I manually run ifup eth0:0). –  David W Mar 26 at 10:59

I would call the original interface eth0 and the second interface eth0:1

share|improve this answer
    
As I indicated in my original post, I already tried that. Good thought, though. –  David W Mar 26 at 10:59
    
I misunderstood your answer here. You were semi-right. The original device's file, and the device name inside the file, had to be set to "eth0", and the 2nd interface had to be set to "eth0:0" –  David W Mar 29 at 18:23

Your Answer

 
discard

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.