Set IP addresses and default route

In the above figure, there are two LANs in our organization. First LAN 192.168.2.0/24 is for lab2 and second LAN 192.168.3.0/24 is for lab3. Router 0 is connected to WAN through ISP's router called RouterISP. RouterISP will forward all packets targeted to 2.16.2.1 from Internet to Router0.

PC1 with IP address 192.168.2.3 (with gateway set to 192.168.2.1) will be able to forward its packets to the Internet. But Host in the Internet will not be able to send reply to 192.168.2.3. Therefore we need to configure PAT in Router0.

Let us set IP address in all the interfaces below.

Router0(config)#interface Gi0/2

Router0(config-if)#ip address 2.16.2.1 255.255.255.252

Router0(config-if)#no shutdown

Router0(config-if)#interface Gi0/0

Router0(config-if)#ip address 192.168.2.1 255.255.255.0

Router0(config-if)#no shutdown

Router0(config-if)#interface Gi0/1

Router0(config-if)#ip address 192.168.3.1 255.255.255.0

Router0(config-if)#no shutdown

RouterISP(config)#interface Gi0/2

RouterISP(config-if)#ip address 2.16.2.2 255.255.255.252

RouterISP(config-if)#no shutdown

RouterISP(config-if)#interface Gi0/1

RouterISP(config-if)#ip address 8.8.8.1 255.255.255.0

RouterISP(config-if)#no shutdown

Before configuting PAT, we need to set default gateway in Router0 so that all the Internet traffic are forwarded to RouterISP.

Router0(config)#ip route 0.0.0.0 0.0.0.0 2.16.2.2

You will now be able to successfully ping 8.8.8.8 (with gateway in 8.8.8.8 set to 8.8.8.1)

Router0#ping 8.8.8.9

Last modified: Tuesday, 28 April 2020, 2:21 PM