Sign up ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I have a Debian web server and I'm trying to bind 2 public IP addresses to it.

We have 2 internet connections, the modem for the first is at (we'll call the public ip AAA.AAA.AAA.AAA) and the other is at (BBB.BBB.BBB.BBB).

Can someone help me out with the /etc/network/interfaces file?

Right now I can connect from BBB.BBB.BBB.BBB and from the LAN, but not from AAA.AAA.AAA.AAA

I'd like to use for outgoing connections, either one will work though.

Here is my current /etc/network/interfaces file:

auto lo
iface lo inet loopback

allow-hotplug eth0
allow-hotplug eth0:0
allow-hotplug eth0:1

auto eth0
iface eth0 inet static

auto eth0:0
iface eth0:0 inet static
        address BBB.BBB.BBB.BBB

auto eth0:1
iface eth0:1 inet static
        address AAA.AAA.AAA.AAA
#       gateway

Any help would be greatly appreciated.


Edit: Finally got it working. Found this article which helped a lot. I had to also set up a 3rd interface for the local network to route the second connection.

share|improve this question
What you are asking is not even remotely trivial to do. I am not even sure if you can do this. You are going to have to really complex routing to make this possible. See this as a starting point. –  Zoredache Oct 17 '13 at 20:50
That seems pretty simple :) Thanks! I'll give this a shot once everyone leaves the office, they're starting to get tired of the website going down ;-) –  user264440 Oct 17 '13 at 21:21
Still can't quite figure it out. I changed the other gateway lan ip to another subnet to simplify things ( –  user264440 Oct 17 '13 at 22:50

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.