05-26-2019 09:56 PM
Hi, I'm a newbie and still struggling with vlans. I have a topology shown in the diagram. I want to assign PC0 and PC1 to two different vlans, and I want both PCs to have internet connection. Is it possible? If yes, what should be the gateway ip address?
I've only learned about inter-vlan routing using subinterfaces, but this method does not seem to support internet connection.
Solved! Go to Solution.
05-26-2019 10:33 PM
Hi @kkct ,
Try with this:
Router2
Interface g0/0
no ip address
exit
interface g0/0.10
ip address 192.168.10.254 255.255.255.0
ip nat inside
exit
interface g0/0.20
ip address 192.168.20.254 255.255.255.0
ip nat inside
exit
interface g0/1
ip address X.X.X.X X.X.X.X
ip nat outside
exit
ip route 0.0.0.0 0.0.0.0 g0/1
access-list 1 permit 192.168.10.0 0.0.0.255
access-list 1 permit 192.168.20.0 0.0.0.255
ip nat inside source list 1 interface g0/1 overload
PC0
192.168.10.1
255.255.255.0
192.168.10.254
PC1
192.168.20.1
255.255.255.0
192.168.20.254
Regards
05-26-2019 10:33 PM
Hi @kkct ,
Try with this:
Router2
Interface g0/0
no ip address
exit
interface g0/0.10
ip address 192.168.10.254 255.255.255.0
ip nat inside
exit
interface g0/0.20
ip address 192.168.20.254 255.255.255.0
ip nat inside
exit
interface g0/1
ip address X.X.X.X X.X.X.X
ip nat outside
exit
ip route 0.0.0.0 0.0.0.0 g0/1
access-list 1 permit 192.168.10.0 0.0.0.255
access-list 1 permit 192.168.20.0 0.0.0.255
ip nat inside source list 1 interface g0/1 overload
PC0
192.168.10.1
255.255.255.0
192.168.10.254
PC1
192.168.20.1
255.255.255.0
192.168.20.254
Regards
05-27-2019 12:13 AM
Thank you so much! I don't know that NAT can be used in this way as it is not mentioned in the textbook
Discover and save your favorite ideas. Come back to expert answers, step-by-step guides, recent topics, and more.
New here? Get started with these tips. How to use Community New member guide