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

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

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?

8 Replies

What does the ifconfig command report on your system?

````
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)
````

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

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

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

@PHLAK:

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

@PHLAK:

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.

@PHLAK:

# 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.

Reply

Please enter an answer
Tips:

You can mention users to notify them: @username

You can use Markdown to format your question. For more examples see the Markdown Cheatsheet.

> I’m a blockquote.

I’m a blockquote.

[I'm a link] (https://www.google.com)

I'm a link

**I am bold** I am bold

*I am italicized* I am italicized

Community Code of Conduct