Two routers, two switches, bunch of deviecs

aerohk

Prominent
Mar 15, 2017
2
0
510
Hello! I am wondering if anyone could validate if my network design is possible to implement.

- I have a modem connected to the WAN port on a regular router. The router gets a public IP from the modem, has a LAN IP of 192.168.0.1/24, and then through internal DHCP server it hands out 192.168.0.[2-255] to devices connected to its LAN ports. I plugged in my laptop to the LAN port, my laptop gets an IP of 192.168.0.2, and it can access the internet. Sweet!

- I have another router that runs Cisco IOS with 3 ports (ETH0/ETH1/ETH2). ETH0 is connected to one of the LAN ports on the first router. I assigned 192.168.10.1/24 to ETH1, 192.168.20.1/24 to ETH2 via Cisco IOS, and did nothing to ETH0.

- I have two switches, the first switch is connected to ETH1, the second switch is connected to ETH2.

- I have 4 devices (A,B,C,D) with the following configurations:
Device A connected to the first switch, with IP=192.168.10.10/24, GW=192.168.10.1, DNS=192.168.0.1
Device B connected to the second switch, with IP=192.168.20.10/24, GW=192.168.20.1, DNS=192.168.0.1
Device C connected to the second switch, with IP=192.168.20.11/24, GW=192.168.20.1, DNS=192.168.0.1
Device D connected to the second switch, with IP=192.168.20.12/24, GW=192.168.20.1, DNS=192.168.0.1

I have never used Cisco IOS, thus I am not familiar with its capabilities. Is it theoretically possible to configure the Cisco router in such a way that all 4 devices can access the internet (I assume I need to configure NAT?), and that the router can route traffics between the two switches, with the exception that I want to block traffic between Device A and Device B? Do you see anything fundamentally wrong with the above configurations?

Thank you in advance!
 
Solution
No. NAT is only necessary when many devices are using a single IP to access a network.
What you want is routing. Devices send internet bound messages to the default gateway, which is the interface address of the router on the device subnet (e.g. 192.168.20.1 for devices on 192.168.20.0/24).
The router then must be configured to forward these messages to 192.168.0.2 so they can reach the internet.

Note that you must be using PPPoE between the first router and modem, or there is in fact another local subnet between the router and modem that must not clash with your other subnets. You must have it working anyway.
Yes you can do what you want to do. I would not run NAT on the CISCO though unless you have a specific reason for doing so. NAT is being run on the router attached to your ISP connection. Running NAT on the Cisco would create a double NAT for the devices attached to the Cisco. A double NAT is usually avoided if possible unless you have a specific reason for doing it.
 
Cisco router needs to have an IP on ETH0 of 192.168.0.X, and this needs to be excluded from the DHCP range on the first router where X is some number from 2 to 254.
DHCP also shouldn't be able to assign .255 as this is the broadcast address.
Cisco then needs to allow routing from 192.168.10.0/24 to 192.168.0.0/24 and from 192.168.20.0/24 to 192.168.0.0/24, with next hop gateway as 192.168.0.1.
Don't configure NAT in the Cisco.
 

aerohk

Prominent
Mar 15, 2017
2
0
510
Thank you for the responses so far! Okay I will assign the Cisco router ETH0 port as 192.168.0.1/255.255.255.0, the first router LAN as 192.168.0.2/255.255.255.0, and the first router DHCP as 192.168.0.[3-254].

Both answers recommend not to use NAT on the Cisco router. However, note that ETH0/ETH1/ETH2 are on different network (192.168.0.0/192.168.10.0/192.168.20.0 respectively, all with a mask of 255.255.255.0). Does the router know how to route traffics going into/out-of these ports out of the box? Say Device A wants to visit www.google.com, isn't NAT necessary between ETH0 and ETH1?

Thanks again.
 
No. NAT is only necessary when many devices are using a single IP to access a network.
What you want is routing. Devices send internet bound messages to the default gateway, which is the interface address of the router on the device subnet (e.g. 192.168.20.1 for devices on 192.168.20.0/24).
The router then must be configured to forward these messages to 192.168.0.2 so they can reach the internet.

Note that you must be using PPPoE between the first router and modem, or there is in fact another local subnet between the router and modem that must not clash with your other subnets. You must have it working anyway.
 
Solution