LAN Routing
cancel
Showing results for 
Search instead for 
Did you mean: 

Connecting 2 networks with different subnets

 
Sruly
Occasional Visitor

Connecting 2 networks with different subnets

Hi,

 

I have  2 buildings- each with their own networks, switches, routers etc.

Building A is on the 192.168.168.0 network and Building B is on the 192.168.1.0 network.

We ran fiber to connect the 2 buildings together. I am using a static route on my router to get the networks to talk to each other- but I think it is slowing things down- I'm only getting 90-150Mbps instead of 500-1000Mbps.

 

So I want to try having the switches do the routing. I've attached a diagram of the current network topology.

 

From what I understand- I need to create a new VLAN on each switch- with the IP address of the other buildings network. Then add the fiber port # on the switch to that new VLAN as TAGGED. Then enable IP Routing on both switches.

 

My question is:

1) Is that all I need to do?

2) What IP should I give the VLAN- a random IP- or something like 192.168.1.0 (the whole network)?

3) I still want the router to deal with all other routing- will doing this interfere?

 

 

Thanks for your help!

 

 

 

 

 

2 REPLIES
Vince-Whirlwind
Honored Contributor

Re: Connecting 2 networks with different subnets

If you enable routing on both switches, you will need to:

1. Change all your hosts' default GWs to point at the switch IP address instead of the router IP address

(eg, building A hosts' default GW needs to be 192.168.168.1)

2. Add to each switch a default route pointing at its local router 
(eg, Building A needs 0.0.0.0 0.0.0.0 --> 192.168.168.168)

3. Create on each switch a new VLAN, VLAN2, giving it an address of, eg, 192.168.99.1 at Building A, and 192.168.99.2 at Building B

4. Add to each switch a static route for the other switch's subnet pointing at the other switch's IP address in VLAN2.

(eg, Building A needs 192.168.1.0/24-->192.168.99.2)

5. On both switches, on the switchport that is patched to the other switch, change it to VLAN2 Untagged.

Sruly
Occasional Visitor

Re: Connecting 2 networks with different subnets

Thank you very much- it worked.

 

2 things to point out.

 

1) You can get around having to change the Gateway IP on every device by simply swapping the switch IP with the router (former gateway) IP. This way all devices are still pointing to the correct gatweay.

 

2) To ensure that DHCP works correctly: Set a ip helper address of the same side router and change the DHCP server gateway address to be the switch.