# connect two routers to each other



## lievenv (Jan 17, 2007)

Hi,

I have two D-Link DGL-4300 routers of which I'm currently only using one.
I need more ethernetports however and wanted to connect them to each other.
I'll call the router that's behind the cable modem right now router1 and the 2nd router router2.

I tried this using the wan port of router2 and connecting it to a lan port on router1 but can't get it to work.
I tried with a static ip address on router1 and giving it another subdomain which I entered into router2's setup and disabling the WAN dhcp there etc...
Before I go on fiddling with this setup, is this at all possible? Connecting router2's wan port to router1's lan port and access the internet from a pc behind router2 that is?
If not, can i get it to work if I connect a lan port on router2 to a lan port on router1? If yes, how would I do that then?

I have router2 lying around and this would save me from having to buy more hardware.

thanks,
V


----------



## peterhuang913 (May 24, 2008)

LAN port to LAN port, not WAN. For example, I would plug in a regular ethernet cable on both port 4's. Then disable the DHCP on the 2nd router.


----------



## johnwill (Sep 26, 2002)

Connecting two (or more) SOHO broadband routers together.

*Note:* _The "primary" router can be an actual router, a software gateway like Microsoft Internet Connection Sharing, or a server connection that has the capability to supply more than one IP address using DHCP server capability. No changes are made to the primary "router" configuration._

Configure the IP address of the secondary router(s) to be in the same subnet as the primary router, but out of the range of the DHCP server in the primary router. For instance DHCP server addresses 192.168.0.2 through 192.168.0.100, I'd assign the secondary router 192.168.0.254 as it's IP address, 192.168.0.253 for another router, etc.

_*Note: Do this first, as you will have to reboot the computer to connect to the router again for the remaining changes.*_

Disable the DHCP server in the secondary router.

Setup the wireless section just the way you would if it was the primary router, channels, encryption, etc.

Connect from the primary router's LAN port to one of the LAN ports on the secondary router. If there is no uplink port and neither of the routers have auto-sensing ports, use a cross-over cable. Leave the WAN port unconnected!

This procedure bypasses the routing function (NAT layer) and configures the router as a switch (or wireless access point for wireless routers).

For reference, here's a link to a Typical example config using a Netgear router


----------



## lievenv (Jan 17, 2007)

Ok, I don't know how I did it, cos I did exactly the same thing as before but now it's working, through the wan port.
Here's what I did in the order I did it the second time. Router1 was still set up from before, I just plugged in the ethernetcable coming from router2's wan port.


1. Set router1's ip to 193.168.0.1
2. Add DHCP reservation for router2 to router1 (193.168.0.126)

- 1 and 2 were still set up from previous try -

3. Hook up router2's wan port to a lan port on router1
4. Set router2's Wan Mode to static (instead of DHCP)
5. Set router2's ip address to 193.168.0.126
6. Set router2's Subnet Mask to 255.255.255.0
7. Set router2's Default Gateway to 193.168.0.1
8. Set router2's Primary DNS Server to 193.168.0.1

I forgot the order I did things in the first time.
Would the order matter that much?
I guess it must have something to do with when the dhcp server assigns an ip? or not?

Any ideas on this?

V


----------



## johnwill (Sep 26, 2002)

The only way it works through the WAN port is if the router allows you to disable the NAT layer, which basically turns that router into a switch and includes the WAN port.


----------

