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 192.168.1.1 (we'll call the public ip AAA.AAA.AAA.AAA) and the other is at 192.168.2.1 (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 192.168.1.1 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
address 192.168.1.101
netmask 255.255.255.0
gateway 192.168.1.1
dns-nameservers 8.8.8.8 8.8.4.4
auto eth0:0
iface eth0:0 inet static
address BBB.BBB.BBB.BBB
netmask 255.255.255.252
auto eth0:1
iface eth0:1 inet static
address AAA.AAA.AAA.AAA
netmask 255.255.255.252
# gateway 192.168.2.1
Any help would be greatly appreciated.
Thanks!!
Edit: Finally got it working. Found this article http://www.debian-administration.org/article/377/Routing_for_multiple_uplinks which helped a lot. I had to also set up a 3rd interface for the local 192.168.2.1/16 network to route the second connection.