Avatar of AXISHK
AXISHK
 asked on

VLAN Configuration on Cisco Switch

I have a CIsco switch configured with 2 VLAN, 192.168.1.0 & 192.168.2.0

How can I configure the switch such that these two VLAN can access access a internet router connected to this switch as well ? Any configuration example for reference ?

Thx
* VLANCiscoSwitches / Hubs

Avatar of undefined
Last Comment
Predrag Jovic

8/22/2022 - Mon
Gammelgaard

The two VLANs need the router as default gateway - your router should be part of both VLANs, with ip addresses. Then, on your router you have to make NAT statements for both VLANs
Predrag Jovic

Classical example with L2 switch and router would be router on a stick.
How To Configure Router On A Stick - 802.1q Trunk To Cisco Router
With L3 switch you can have one VLAN that will forward traffic to router, so VLANs are not extending to router.
AXISHK

ASKER
"Ip nat inside" on two VLAN sub-interface, so the "ip nat outside" will be on the interface connecting to WAN, correct ?

Any example on using L3 switch in this case ?

Thx
Your help has saved me hundreds of hours of internet surfing.
fblack61
ASKER CERTIFIED SOLUTION
Predrag Jovic

Log in or sign up to see answer
Become an EE member today7-DAY FREE TRIAL
Members can start a 7-Day Free trial then enjoy unlimited access to the platform
Sign up - Free for 7 days
or
Learn why we charge membership fees
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.
Not exactly the question you had in mind?
Sign up for an EE membership and get your own personalized solution. With an EE membership, you can ask unlimited troubleshooting, research, or opinion questions.
ask a question
AXISHK

ASKER
"access-list 1 permit 192.168.0.0 0.0.1.255"

Does it permit IP address from 192.168.0.0 - 192.168.1.255 ?  Correct ?

Thx
Predrag Jovic

Correct.
That's the range I used in example.
For your example - 192.168.1.0 and 192.168.2.0 you need two statements.
access-list 1 permit 192.168.1.0 0.0.0.255
access-list 1 permit 192.168.2.0 0.0.0.255
AXISHK

ASKER
Thx
Get an unlimited membership to EE for less than $4 a week.
Unlimited question asking, solutions, articles and more.
Predrag Jovic

You're welcome.