How can I connect two networks with different IP addresses?

DeMus September 7, 2011

I have a router with IP addresses 192.168.0.x. (1st network).
Connected to a LAN connection is a second router with addresses 192.168.1.x. (2nd network).
How do I make it possible for both networks to see each other, and to have internet from the 2nd as well as the 1st?

  1. Anonymous
    September 8, 2011 at 1:57 pm

     if you simply change the subnet mask from to
    So the network range is: to you use a subnet mask of that case, the network range is in your case: to

    • Mike
      September 8, 2011 at 2:49 pm

      The idea is good but I'm tempted to say it won't work since most home routers don't allow a Class C network ( being divided with a Class B CIDR/Subnetmask (CIDR /23,

      Even if they do it's still not advisable because older devices could face routing problems within the supernet. Also both Routers would need to support RIPv2

  2. Mike
    September 8, 2011 at 10:23 am

    For internet access all you have to do is properly setup the second router:

    connect the WAN port to the first router
    set the WAN interface to either DHCP or manual/Static (whatever is available)

    for manual or static the following needs to be done:
    set the WAN IP Address and Subnetmask to one on the first network (e.g.
    set the WAN Gateway and DNS-Server to the first routers IP (e.g.

    The Ethernet side of the second Router should be setup as usual
    IP Address of the Router e.g.
    DHCP enabled, handing out e.g. with Gateway and DNS-Server

    This is a very basic setup using the NAT feature of the Router and will allow all your clients to access the internet. 

    If you need networking features between clients on both networks you will either have to enable advanced routing on the first router and add the appropriate routes to the network behind the second Router or use the easier and better option by combining both networks into one 192.168.0.x

    • DeMus
      September 8, 2011 at 5:24 pm

      Hi Mike, thank you for answering. In the first router (192.168.0.x) what should I fill in as rule so computers on the second segment (192.168.1.x) can connect to the first segment as well as to the internet which is connected to the first segment? I have a D-Link DIR-100 router should that be of any help.

      • DeMus
        September 8, 2011 at 5:27 pm

        Forget about the attached file, that was a mistake. Sorry

      • Mike
        September 8, 2011 at 7:49 pm

        If you were able to follow my instruction and everything is setup as expected the clients on the second network ( should already have access to the internet.

        How it should look like
        Router 1 nothing changed at IP
        all connected clients should have internet access

        Router 2 with WAN connected to Router 1
        WAN set to static/manual
        IP =
        GW =
        DNS = or from your provider, whatever works

        LAN IP Address =
        DHCP enabled
        Range =
        (GW = if there is an option to set it)
        DNS = or from your provider, whatever worksIf you need connection between the LANs other then Internet access the static route on Router 1 should beDestination = Mask = = in words: You have to tell your first Router where it can find the second network.Should work, can work, but doesn't have to... there is a lot that can go "wrong", problems with Network Address Translation or the used Routing Protocol, problems with DHCP being forwarded to the second network ~ most of the time problems occur with firmware fixed "settings" that are not available to the user.

        I once had a router that simply won't do the job with both networks being Class C (192.168.x.x). After changing the second network to Class A (10.x.x.x) it did work.

        Unless you do need different Subnets I still recommend setting up a single large 192.168.0.x network ~ easier and safe to use. In that case Router 2 would just need a static IP e.g. and then connect it to the first router via a LAN Port.

        • Mike
          September 8, 2011 at 7:51 pm

          add to single large network: of course DHCP should be disabled on Router 2  then

        • Demus
          September 10, 2011 at 5:30 pm

          Hello Mike, thanks again for your answer. It's not that I "need" 2 network segments, I was just curious if this can be done, and if yes how.
          At the moment I did what you also wrote at the end of your story, connect the two routers with a LAN connection and switch of the DHCP in the 2nd router making it a switch. Tomorrow morning when I am alone in the house I will play around again, now I am only disturbing others when I reboot the routers.
          One question though: in my Dlink DIR-100 router I see a page Static Routing where I can fill in the items you mentioned: Dest IP, Subnet mask and Gateway. Only, at the beginning of each line it says Interface: WAN, which I can not change. Is this correct?
          Okay tomorrow I will give it a try. Let's see what comes out. Thanks again.

        • Mike
          September 10, 2011 at 10:04 pm

          I looked through some interface screenshots of the DIR-100
          It appears it only allows entries in WAN direction - my personal advice? Just test it without the static route. 

          Maybe it works out of the box. With NAT on the second router it's possible that it will just work. Also, thinking about how NAT works it might be that you actually need a static route on the DD-WRT router to tell it that there is "more than internet" (another part of the local network) behind the WAN interface.

          Unfortunately my second Router is on loan and I'm not eager to setup a linux router for this single testing purpose. Just give it a try and report back.

        • DeMus
          September 11, 2011 at 5:13 am

          I give up. I tried everything you wrote and, when this didn't work, even more.

          Router 1 (connected to the internet):
          WAN is DHCP from modem
          LAN is DHCP with addresses (50 addresses), mask
          LAN address router is

          Router 2 (WAN) to router 1 (LAN)
          WAN address fixed to, mask, gateway
          LAN is DHCP with addresses (50 addresses), mask
          LAN address router is

          In router 1 I tried you static rule, but this didn't bring anything.
          I also tried some rules in the 2nd router to direct addresses outside segment 2 through the 2nd router (gateway) to the 1st segment, and if necessary through router 1 (gateway) to the internet. Didn't work.

          Now I am back at square 1:
          1 router with addresses ~149
          1 wireless switch (used to be router 2) for generating wireless contact to my laptop.
          It all works so I keep it like this. Experiment is over.

          Mike, thank you for your help and your patience to help me.

    • Bob Barnes74
      February 1, 2012 at 1:14 am

      Very well put.....Tony Seven.

  3. Bruce Epper
    September 8, 2011 at 8:02 am

    A router is going to have at least 2 IP addresses, one on each side of it.  For what you are describing, you only need one router to connect the 2 network(s) or network segments together.  One interface needs to have an IP address to match the first subnet and the second interface needs to have an IP address to match the second subnet.  All machines on the second subnet need to point to the address on the second router interface as its default gateway assuming that the internet connection is on the first subnet.  The machines on the first subnet can have a default gateway of the internet router/modem or the internal router's first interface depending on what is is normally accessing.  (It will still find the proper host no matter which interface you point it at from the first subnet.)

Ads by Google