4

I want to set up two IP addresses on my system for access through LAN. This is my config on my other system.

Desktop Installation

My Connection Information

My desktop installation runs with multiple IPs added through Network Manager 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 receive

Failed to bring up eth0:1

What am I doing wrong?

  • 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. – le3th4x0rbot Oct 24 '12 at 00: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 08: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
  • 1
    Registered User, I guess the server install has no GUI. – NGRhodes Oct 29 '13 at 10:00
  • Why did you start at iface eth0:1 and not eth0:0, that might mess with things – peterretief Mar 03 '16 at 11:19

3 Answers3

1

An alias interface should not have a gateway.

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

NGRhodes
  • 9,490
  • 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
1

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
muru
  • 197,895
  • 55
  • 485
  • 740
0

I know this comes in a little late but my guess is that you can do the following:

edit /etc/network/interfaces

auto venet 0:0
iface venet 0:0 inet static
        address XXX.XX.XXX.XXX
        netmask 255.XXX.XXX.XXX

auto venet 0:1
iface venet 0:1 inet static
        address XXX.XX.XXX.XX1
        netmask 255.XXX.XXX.XXX

auto venet 0:2
iface venet 0:2 inet static
        address XXX.XX.XXX.XX2
        netmask 255.XXX.XXX.XXX
muru
  • 197,895
  • 55
  • 485
  • 740
Phil
  • 1