LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Multiple Public IP problem in Ubuntu 14.04 Server. (https://www.linuxquestions.org/questions/linux-newbie-8/multiple-public-ip-problem-in-ubuntu-14-04-server-4175572149/)

drpaudel 02-13-2016 04:21 AM

Multiple Public IP problem in Ubuntu 14.04 Server.
 
I want to use 2 different Public IP in same Ubuntu 14.04 Server. I am using 2 Different routers with IP forwarding.
I have 2 ethernet ports eth0 and eth1. In my scenario Only one Static ip at a time is working. How can I make both public IP working remotely? Both IP are from different ISP.
Quote:

iface eth0 inet static
address 192.168.10.100
netmask 255.255.255.0
network 192.168.10.0
broadcast 192.168.10.255
Quote:

auto eth1
iface eth2 inet static
address 192.168.4.100
netmask 255.255.255.0
network 192.168.4.0
gateway 192.168.4.1
dns-nameserver 192.168.4.1
dns-search local
What could be the possible solution and ethernet script.

jpollard 02-13-2016 12:59 PM

Depends on what you are doing. There is nothing wrong with what you have.

If you are connecting to a 192.168.10.xx address it will go out eth0.
If you are connecting to a 192.168.4.xx address OR an unknown address it will go out eth1.

You can only have ONE default gateway, and that default gateway is designated to be 192.168.4.1 - so any unknown outgoing addresses will be sent to that address via eth1.

You CAN specifiy specific addresses to use a different route - but these are something you do manually/put in a script to set at boot time. You would have to look at setting static routes - for Ubuntu I believe this file is /etc/network/interfaces


All times are GMT -5. The time now is 06:36 AM.