Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I want to setup two ip addresses on my system for access through lan. This is my config on my other system.

Desktop Installation

my ip

My desktop installation runs with multiple IP's added through networkmanager both through lan and wifi.

Server Installation

On my server install I've edited /etc/network/interfaces to the following.

auto eth0
auto eth0:1
# IP-1
iface eth0 inet static
address 172.16.35.35
network 172.16.34.1
netmask 255.255.254.0
broadcast 172.16.35.255
dns-nameservers 172.16.100.221 8.8.8.8
# IP-2
iface eth0:1 inet static
address 172.16.34.34
network 172.16.34.1
netmask 255.255.254.0
gateway 172.16.34.1
broadcast 172.16.35.255

After restarting through "/etc/init.d/networking restart" I recieve "Failed to bring up eth0:1"

What am I doing wrong? Thankyou.

share|improve this question
    
There is a typo on the broadcast address of eth0, it should be 172.16.35.255 instead of 172.166.35.255. Other than that the config looks good. Try fixing the problem and seeing if the networking will reset. If not see if can find more details in the syslog, or dmesg. –  Bailey S Oct 24 '12 at 0:39
    
Bailey S: Sorry that was a typo here but it was fixed in the actual file.But to no avail i'm still getting "Failed to bring up eth0:1". How do i go about with syslog or dmesg –  varunyellina Oct 24 '12 at 8:32
1  
@varunyellina Shouldn't network 172.16.34.1 be network 172.16.34.0? –  carestad Oct 24 '12 at 23:47
    
why dont you use GUI of Network Manager to do the same? you are trying to bring 2 different subnets on same NIC, i m surprised address of eth0 falls outside the range of subnet and still it is up –  Registered User Oct 15 '13 at 13:03
    
Registered User, I guess the server install has no GUI. –  NGRhodes Oct 29 '13 at 10:00

3 Answers 3

An alias interface should not have a gateway.

https://wiki.debian.org/NetworkConfiguration#Multiple_IP_addresses_on_One_Interface

share|improve this answer
    
If you see my answer to the question, having a gateway on the alias interface didn't cause any issues for me. Hope i'm not wrong in an entirely different situation. –  varunyellina Oct 30 '13 at 14:20

My suspicion is that you are attempting to add a second default route, or some other duplicate route. There are a few steps to verifying this theory.

First, even though you are getting the error message, an ifconfig should show that eth0, and eth0:1 are up with the correct addresses.

Second, run route -n. Is there a default gateway already? Is it 172.16.34.1? For extra credit paste the output of route -n to your question, if it is not too hard to do.

Third, if I am correct about the route being the issue, commenting out the route directive on eth0:1 should allow the networking to be restarted without error. If the error persists, attempt rebooting the machine to ensure that the networking is started from a clean state.

share|improve this answer

It has been a long time since I posted this question. While I never got around to configuring the old server with multiple addresses, the following is a working configuration I'm using on a different server currently.

    auto eth0
    iface eth0 inet static
            address 172.16.100.125
            netmask 255.255.255.0
            network 172.16.100.0
            broadcast 172.16.100.255
            gateway 172.16.100.1
            dns-nameservers 172.16.100.221 208.67.222.222

    auto eth0:0
    iface eth0:0 inet static
    name Ethernet alias LAN card
            address 172.16.100.123
            netmask 255.255.255.0
            network 172.16.100.0
            broadcast 172.16.100.255
            gateway 172.16.100.1
share|improve this answer

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.