Linode Forum Index Linode Forum
Linode Community Forums
 


Trouble using multiple IPs on one linode

Click here to go to the original topic

 
       Linode Forum Index -> Linux Networking
Author Message
PHLAK



Joined: 23 May 2011
Posts: 10

Posted: Wed Jun 15, 2011 7:35 pm    Post subject: Trouble using multiple IPs on one linode  

I just got a second IP for my linode and have followed the example in the Static IP library article and configured my /etc/network/interfaces with the following

Code: # 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

# Interfaces brought up durring boot
auto eth0 eth0:0 eth0:1

# eth0 - Public IP, WAN access
iface eth0 inet static
    address 173.255.199.148
    netmask 255.255.255.0
    gateway 173.255.199.1

# eth0:0 - Public IP, WAN access
iface eth0:0 inet static
    address 96.126.115.54
    netmask 255.255.255.0
    gateway 96.126.115.1

After doing this I ran "/etc/init.d/networking restart" and it restarted successfully. However, I am unable to ping into 96.126.115.54 or out to it's corresponding gateway, 96.126.115.1, I get the following:

Code: chris@Megatron:~$ ping 96.126.115.1
PING 96.126.115.1 (96.126.115.1) 56(84) bytes of data.
From 96.126.115.54 icmp_seq=2 Destination Host Unreachable
From 96.126.115.54 icmp_seq=3 Destination Host Unreachable
From 96.126.115.54 icmp_seq=4 Destination Host Unreachable

Am I missing something? What do I need to do in order to get this IP working in conjunction with the other?
Back to top  
NeonNero



Joined: 04 Jan 2005
Posts: 215
Location: Ålesund, Norway

Posted: Wed Jun 15, 2011 7:45 pm    Post subject:  

What does the ifconfig command report on your system?
Back to top  
PHLAK



Joined: 23 May 2011
Posts: 10

Posted: Wed Jun 15, 2011 7:49 pm    Post subject:  

Code: chris@Megatron:~$ ifconfig
eth0      Link encap:Ethernet  HWaddr fe:fd:ad:ff:c7:94
          inet addr:173.255.199.148  Bcast:173.255.199.255  Mask:255.255.255.0
          inet6 addr: fe80::fcfd:adff:feff:c794/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:24160080 errors:0 dropped:0 overruns:0 frame:0
          TX packets:44780256 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:3037553709 (3.0 GB)  TX bytes:4081507899 (4.0 GB)
          Interrupt:44

eth0:0    Link encap:Ethernet  HWaddr fe:fd:ad:ff:c7:94
          inet addr:96.126.115.54  Bcast:96.126.115.255  Mask:255.255.255.0
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          Interrupt:44

lo        Link encap:Local Loopback
          inet addr:127.0.0.1  Mask:255.0.0.0
          inet6 addr: ::1/128 Scope:Host
          UP LOOPBACK RUNNING  MTU:16436  Metric:1
          RX packets:416024 errors:0 dropped:0 overruns:0 frame:0
          TX packets:416024 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:45761029 (45.7 MB)  TX bytes:45761029 (45.7 MB)
Back to top  
db3l



Joined: 13 May 2009
Posts: 556

Posted: Wed Jun 15, 2011 8:41 pm    Post subject:  

Just a quick check, but have you rebooted your Linode after having the new address allocated? I know you have to do that for private addresses, and believe for additional public addresses as well.

Before that you can actually make everything look proper from your internal guest viewpoint but it's still not going to work.

-- David
Back to top  
PHLAK



Joined: 23 May 2011
Posts: 10

Posted: Wed Jun 15, 2011 9:49 pm    Post subject:  

I thought running "/etc/init.d/networking restart" would be sufficient, but I'll try rebooting it.
Back to top  
PHLAK



Joined: 23 May 2011
Posts: 10

Posted: Wed Jun 15, 2011 9:50 pm    Post subject:  

That seemed to work, thanks. Not sure why restarting the networking service didn't do it.
Back to top  
db3l



Joined: 13 May 2009
Posts: 556

Posted: Wed Jun 15, 2011 10:37 pm    Post subject:  

PHLAK wrote: That seemed to work, thanks. Not sure why restarting the networking service didn't do it.
I'm not familiar with the Xen technical details, but believe that changing this sort of resource assigned to your Linode requires host-level reconfiguration as well, which only takes place during a restart.

So it's not that it corrected something within your virtual machine (restarting networking was fine for that), but that the host environment hadn't yet been configured to allow the new address.

-- David
Back to top  
carmp3fan



Joined: 14 Feb 2009
Posts: 116

Posted: Wed Jun 15, 2011 10:37 pm    Post subject:  

PHLAK wrote: That seemed to work, thanks. Not sure why restarting the networking service didn't do it.

It would work on a non-Linode system. The Linode system requires a reboot to assign IPv4 addresses and, I believe, initial IPv6 addresses.
Back to top  
mnordhoff



Joined: 03 May 2008
Posts: 451

Posted: Thu Jun 16, 2011 5:00 pm    Post subject: Re: Trouble using multiple IPs on one linode  

PHLAK wrote: Code: # 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

# Interfaces brought up durring boot
auto eth0 eth0:0 eth0:1

# eth0 - Public IP, WAN access
iface eth0 inet static
    address 173.255.199.148
    netmask 255.255.255.0
    gateway 173.255.199.1

# eth0:0 - Public IP, WAN access
iface eth0:0 inet static
    address 96.126.115.54
    netmask 255.255.255.0
    gateway 96.126.115.1
Although it apparently works for you, there are two errors in this file:

1.) The "auto" line brings up eth0:1, even though you're only using eth0 and eth0:0. (The guide also has an eth0:1 interface for the private network, but you're not using that.)

2.) You should not have a second gateway line for eth0:0.
Back to top  
 
       Linode Forum Index -> Linux Networking
Page 1 of 1