Linode Forum
Linode Community Forums
 FAQFAQ    SearchSearch    MembersMembers      Register Register 
 LoginLogin [ Anonymous ] 
Post new topic  Reply to topic
Author Message
PostPosted: Wed Dec 05, 2012 6:33 pm 
Offline
Senior Member

Joined: Fri Nov 02, 2012 4:20 pm
Posts: 60
I'm having issues adding a second IP address to one interface. Below is my
Code:
/etc/networking/interfaces


Code:
    # The loopback network interface
        auto lo
        iface lo inet loopback
   
    # The primary network interface
    auto eth0 eth0:0 eth0:1
   
    #eth0 is our main IP address
    iface eth0 inet static
     address 198.58.103.*
     netmask 255.255.255.0
     gateway 198.58.103.1
   
    #eth0:0 is our private address
    iface eth0:0 inet static
     address 192.168.129.134
     netmask 255.255.128.0
   
    #eth0:1 is for www.site.com
    iface eth0:1 inet static
     address 198.58.104.*
     netmask 255.255.255.0
     gateway 198.58.104.1



When I run
Code:
/etc/init.d/networking restart
, I get several errors about resolv.conf and then a fail error about bringing up eth0:1:

Code:
    resolvconf: Error: /etc/resolv.conf isn't a symlink, not doing anything.
    ssh stop/waiting
    ssh start/running, process 23229
    RTNETLINK answers: File exists
    Failed to bring up eth0:1.


Any reason this would be? I didn't have any problems with I first set up eth0 and eth0:0.


Top
   
PostPosted: Wed Dec 05, 2012 6:41 pm 
Offline
Senior Member

Joined: Sat May 03, 2008 4:01 pm
Posts: 567
Website: http://www.mattnordhoff.com/
Remove the 'gateway' line from eth0:1.

BTW, the /etc/resolv.conf thing isn't an error, exactly. The system is just whining that automatic management of the file is disabled. If that's what you want, it's not an error.

_________________
Matt Nordhoff (aka Peng on IRC)


Top
   
PostPosted: Wed Dec 05, 2012 6:48 pm 
Offline
Senior Member

Joined: Fri Nov 02, 2012 4:20 pm
Posts: 60
Removed the gateway line and am still seeing the error. I've also tried manually bringing down the interfaces and then bringing them back up.
Code:
sudo ifdown eth0:1
ifdown: interface eth0:1 not configured

Code:
sudo ifup eth0:1
RTNETLINK answers: File exists
Failed to bring up eth0:1.


Top
   
PostPosted: Wed Dec 05, 2012 7:03 pm 
Offline
Senior Member

Joined: Fri Nov 02, 2012 4:20 pm
Posts: 60
I rebooted and that fixed my problem...

Is there a correct way to restart networking? I was doing /etc/init.d/networking restart.


Top
   
PostPosted: Thu Dec 06, 2012 8:59 am 
Offline
Senior Member
User avatar

Joined: Sun Jan 18, 2009 2:41 pm
Posts: 830
Note that a reboot is necessary to add a new IP address (this is a Linode requirement, not a Linux one).


Top
   
PostPosted: Sat Dec 08, 2012 11:19 pm 
Offline
Senior Newbie

Joined: Mon Dec 03, 2012 11:40 am
Posts: 5
The linode tutorial is unclear about the reboot. After adding interfaces, the tutorial says now you can ping the gateway. In fact, you won't be able to ping the second gateway until you reboot.


Top
   
PostPosted: Thu Dec 20, 2012 4:58 pm 
Offline
Senior Member

Joined: Fri Nov 02, 2012 4:20 pm
Posts: 60
Vance wrote:
Note that a reboot is necessary to add a new IP address (this is a Linode requirement, not a Linux one).


Any reason why? A Zen thing?


Top
   
Display posts from previous:  Sort by  
Post new topic  Reply to topic


Who is online

Users browsing this forum: No registered users and 0 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  
RSS

Powered by phpBB® Forum Software © phpBB Group