2

I have two routers connected to each other. Both the routers are connected to the WAN using two different ISPs.

Router A is used for the day to day browsing in the office while Router B is connected to a web server that serves pages to public.

When someone from Router A wants to access our website from Router B, the connection is getting through the WAN. I want to redirect that particular through the LAN instead. Is there any way to do it using the Router A (D-Link DIR-655)?

To summarise, if people in the office want to access pages from 60.51.223.223 (WAN of Router B), the traffic should go through Router B, which resolves the request locally. Router B is a client under Router A.

This is the network map:

Network diagram http://www.nirmalnatarajan.com/images/networkMap.png

2
  • A network diagram would be REALLY helpful, or a description that includes what IP addresses are where and what is connected to the ports on the routers. Also, the "Router B is a client under Router A" statement is not making sense to me.
    – tomjedrz
    Nov 18, 2009 at 5:34
  • I have updated the question with a network diagram.
    – Nirmal
    Nov 19, 2009 at 5:59

4 Answers 4

2

As justinsteven noted, you can use DNS or local hosts files to direct the web site traffic to the internal IP address. Then set a route on each router for the other internal network, and all will work. If the two routers are "consumer grade" this might not be possible.

However ...

This configuration is not very secure, and would be keeping me awake at night. There is no real firewall, the web server is publicly accessible and has unfettered access to the rest of the network. The possibility of routing loops and performance problems is very real. I would take the cable connecting the internal networks out immediately. Sending that traffic through the internet is wise, since you don't have a properly configured network.

A far better solution is to get a good firewall (I like Astaro), plug both ISP connections into it as well as both internal networks, and configure it. Astaro offers a basic version of the software for free, so you can put 4 NICs into an older PC and away you go.

6
  • Thanks for your answer. After setting up a DNS Server, why should we setup a route on both the routers? Won't the DNS server forward the request without the routes?
    – Nirmal
    Nov 20, 2009 at 1:14
  • If the routers are just routers, No. If the routers have built in switches and those switches are connected, it might. The DNS server an IP address. Something has to tell the router where to send traffic for an address not in the subnet of any of it's interfaces.
    – tomjedrz
    Nov 20, 2009 at 2:12
  • You are right! But if you see the diagram, the web server is under the same subnet as of the Router A's LAN. Thanks for your help! I am going to give it a try.
    – Nirmal
    Nov 20, 2009 at 3:22
  • I didn't notice the same subnet. So if you are using the DSL routers with switches, getting the name to resolve internally to the internal address will do the trick. You still need a firewall.
    – tomjedrz
    Nov 21, 2009 at 0:32
  • 1
    I got everything to work as expected. Actually the Astaro firewall itself has got a software router in it. So I managed to eliminate the two separate networks, merged them together, and have setup routing policies for conditional WAN access. Thanks for your suggestion!
    – Nirmal
    Nov 23, 2009 at 11:22
1

Add a route on Router A that uses Router B as the gateway for the networks which Router B serves. (Make sure that Router B has a route back to Router A.)

If this doesn't solve your problem, I highly suggest you reword your question - a network diagram should help.

1
  • Included the network diagram. Please see whether it's clear.
    – Nirmal
    Nov 18, 2009 at 7:43
1

Have a look at the Advanced\Routing tab.

In your example, you'd have something like this:

Name: Whatever
Destination IP: 60.51.223.223
Netmask: 255.255.255.255
Gateway: IP Address of the other router (B)

For further information have a look at the help page.

3
  • I tried that, but the Gateway accepts only a WAN IP and not a local IP.
    – Nirmal
    Nov 18, 2009 at 7:00
  • 1
    That's because you have the interface drop down set to WAN. Change it to the interface that connects to router B.
    – joeqwerty
    Nov 18, 2009 at 15:08
  • Thanks for that suggestion. But there is no other option under interface. Only WAN is available. Is there any method to create a new interface?
    – Nirmal
    Nov 19, 2009 at 5:54
1

It's not the cleanest solution, but if you have an internal name server, you could add an A record for the website's name and give it the internal server address. If you're only talking about a handful of internal machines, you could do this on each via the hosts file.

0

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .