12-02-2019 05:21 AM
Hi all,
I have (a) question(s) about VLANs and Tagging. A customer wants an interface on a Cisco 1921 to be configured for traffic with VLAN 10 tagging. Because the customer is an difficult one, I'm starting to question myself. So i just looking for some answers;
1) To tagg from a switch, one simply puts the interface in the VLAN right?
1.a) If this is correct, then the router just needs an interface configured with an IP in the same subnet, nothing more?
This is not necessary right? Or if there is a DHCP for VLAN10, you will need the sw acc command?
interface GigabitEthernet0/0/0
switchport access vlan 10
no ip address
duplex full
In this construction there is no need for trunking, only one VLAN passes through and tagging is only important for the switch right?
When creating an Router-on-a-stick the router needs subinterfaces and be in trunking mode.
I'm a starting engineer and this still confuses me. :(
Thanks in advance for helping.
12-02-2019 06:00 AM
12-02-2019 06:38 AM - edited 12-02-2019 06:47 AM
Hello
@Jaderson Pessoa wrote:
Hello,
If you use just one network, yes... you just can tag switch's port and it will work... But if you need more than one network you will need create a sub-interface on the router, for exemple:
SW1: interface gi0/1
description TO_ROUTER
switchport mode trunk
VLAN 10
VLAN 20
RT1:
interface gi0/1.10switchport trunkencapsulation dot1q 10
192.168.10.1 255.255.255.0
description VLAN10
interface gi0/1.20switchport trunkencapsulation dot1q 20
ip address 192.168.20.1 255.255.255.0
Also the physical interface in the above example if used by any subnet with be the untagged
example
int gig0/1
ip address 192.168.5.1 255.255.255.0 <untagged
or you can specify another subnet as untagged and use a subinterface
int gig0/1
no ip address
int gig0/1.5
encapsulation dot1q 5 native
ip address 192.168.5.1 255.255.255.0 <un tagged
int gig0/1.10
encapsulation dot1q 10
ip address 192.168.10.1 255.255.255.0 < tagged
int gig0/1.10
encapsulation dot1q 20
ip address 192.168.20.1 255.255.255.0 < tagged
Lastly the sub interface numbering doesn’t have relate to the vlans on the switch it is just the encapsulation number that does however it is recommended to keep them the same for clarification purposes
example:
int gig0/1.12
encapsulation dot1q 10 <vlan 10
int gig0/1.13
encapsulation dot1q 20 < vlan 20
12-02-2019 08:20 AM
There are things about this environment that we do not know and that might impact our advice. But based on what we know so far I believe that we can give this advice:
- this is to be configured on a 1921 router. So we have a layer 3 router connected to some kind of switch.
- the customer has requested tagging for vlan 10.
- if the switch port connecting to the router is set up as an access port in vlan 10 then there will be no tagging.
- if the switch port connecting to the router is to do tagging for vlan 10 then the switch port must be configured as a trunk port, and the native vlan can not be vlan 10.
- on the router if an IP address is configured on the main interface it will process untagged traffic. So to process traffic tagged for vlan 10 the router must be configured with a subinterface for vlan 10.
HTH
Rick
12-02-2019 09:43 AM
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