Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

we got 2 external IPs from our ISP and I'm trying to put them to use. I had to connect the entire network We also have 2 server that host a lot of diffrent stuff (some of it on the same ports) and I'd like to be able to use the two IPs from our ISP on the same subnet for stuff like forwarding port 80 from each IP to a diffrent machine.

Here's what I tried:

  • Two routers, one with DHCP (Router 1) and one in switch mode (Router 2)(connected via LAN ports)
  • Each router is connected to the internet via it's WAN port
  • All computers are in the same subnet hosted by Router1.

But here's my problem:

Port forwarding on Router 1 works perfectly. But on Router 2, it doesn't work at all. The remote admin panel from Router 2 works on it's IP but no port forwards do.

Is there a way to make 2 routers have separate external IPs while still being on the same subnet?

share|improve this question
3  
Why do you have two routers? –  Michael Hampton Mar 7 at 14:19
    
Yes there's a way - just exactly the same as you'd configure a single router - the hard bit is configuring the devices on the LAN to respond to the IP a connection was received via rather than the default route - but you didn't tell us what these are. (for Linux se the iproute2 howto or the LARTC howto) –  symcbean Mar 7 at 15:54

3 Answers 3

up vote 0 down vote accepted

Theoretically, your current solution with your two "residential" style routers should work; however you would have much better luck and more utilities at your disposal by migrating to an entry level multi-wan "commercial" style router, like a ZyXEL USG300.

Regardless of what solution you go with, you'll need to generate routing tables to properly deliver traffic.

For example, if your information is something like:

WAN1: 10.10.10.1
SUBNET MASK: 255.255.255.252
GATEWAY: 172.16.0.1
LAN: 192.168.0.1

WAN2: 10.10.10.2
SUBNET MASK: 255.255.255.252
GATEWAY: 172.16.0.1
LAN: 192.168.0.2

Then, assuming 192.168.0.1 is your default gateway, whatever devices you want to go out through WAN2 will need the LAN of WAN2 as your default gateway. Example (This setup will make the traffic go out through WAN1):

SERVER IP: 192.168.0.100
SUBNET MASK: 255.255.255.0
GATEWAY: 192.168.0.1

Example (This setup will make the traffic go out through WAN2):

SERVER IP: 192.168.0.100
SUBNET MASK: 255.255.255.0
GATEWAY: 192.168.0.2

Note: you'll need to make sure you have your NAT rules in place if you're using "residential" style routers. If you're using "commercial" style routers, you'll need to make sure your port forwarding or firewall rules are set up properly.

share|improve this answer

Yes, you can have the internal interfaces of your routers in a single subnet, and the external ones be completely different IPs. However, most computer systems tend to use a simple routing model by default, with a single gateway providing connectivity. To make use of another, you'll have to add another route on each machine telling them to use the second route when going to a particular address|network.

Or, you could do Like Michael suggests and pick up a Dual WAN router. That way, your internal hosts have a single choice to go outside your network, and decisions on which route to take will be taken on a single device. You can also make use of the multiple public IPs to NAT to different internal hosts, all from a single device.

share|improve this answer
    
A dual WAN router would be nice for more than one ISP. There only seems to be one ISP in use here. –  Michael Hampton Mar 7 at 14:29
    
I guess it depends on the ISP, but if he can get single IPs assigned to multiple routers, that sort of connection would allow for a dual WAN router to work in its place (PPoE, PPoA type of connectivity), though obviously he would lose the advantage of network resiliency if his ISP had issues. –  NickW Mar 7 at 14:38

You need a router with two WAN ports. For example, you can use a computer with pfSense installed and it will assign the external IPs as you need (or just load balance the connections).

If you have to keep two routers as it is now, you have to choose which computers will be using the second IP and configure them to use Router2 as default gateway. Then port forward will work to those computers. However, you will not be able to forward ports from both IPS to a single device (because the device will not know that it has to reply via a different router). To do that, you either need routers that can SNAT, set up static routes (probably not an option here) or a router with two WAN ports (like I initially suggested)

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.