cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
999
Views
4
Helpful
3
Replies

ROAS

Sinosha
Level 1
Level 1
  • Hi professionals,

I wanted to ask, using a configuration below...

Regarding the second command; the VLAN number doesn't have to match. 

Regarding the third command; Does the VLAN number have to match here with the one we configured on the switch? For example; 10 on the switch, and 10 here, on the Router? 

I am asking because I am just interesting how does a router determine which tag belongs to which subinterface? Thank you for your help.

1. Interface g0/0

2. Interface g0/0.10

3. Encapsulation dot1q 10

4. Ip address 192.168.1.62 255.255.255.192
3 Accepted Solutions

Accepted Solutions

Encapsulation dot1q 10 

this vlan-id need to match what you config in SW in vlan database and vlan allow in trunk 



SW
vlan 10 
interface fax/x <<- interface connect to router 
switchport mode trunk 
switchport trunk allow vlan 10

R
interface fa0/0.1000 <<- not matter 
encapsulation dot1q 10 <<- must match VLAN-ID in SW
ip add x.x.x.x mask 

View solution in original post

The subinterface of

g0/0.10

does not have to match but it is helpful for identifying which subinterface belongs to which VLAN. You only have 1 in your example but imagine a network with 10 or 20 subinterfaces. As @MHM Cisco World pointed out the encapsulation number has to match the VLAN youre trying to match becasue its telling the router that wehn you send traffic on this subinterface encapsulate it with the VLAN # tag so when the switch on the other side receives it on its trunk port it knows which VLAN it belongs to and can switch the frames accordingly.

-David

View solution in original post

M02@rt37
VIP
VIP

Hello @Sinosha,

When a router receives a frame with a

 dot1q

header, it uses the information in the header to determine which subinterface should handle the frame.

The

 dot1q 

header contains a VLAN tag that specifies the VLAN ID of the traffic. The router examines this VLAN tag to determine which subinterface is associated with that VLAN. The router compares the VLAN ID in the

 dot1q

header with the VLAN IDs configured on its subinterfaces. If there is a match, the router forwards the frame to the corresponding subinterface.

Each subinterface is configured with a specific VLAN ID using the Encapsulation

 dot1q 

command. This VLAN ID is used as a filter to determine which frames should be accepted by the subinterface. Frames that arrive with a matching VLAN tag are forwarded to the corresponding subinterface, and frames with a different VLAN tag are typically dropped or handled according to the router's configuration.

By associating a VLAN ID with a subinterface, the router can distinguish between different VLANs and treat them as separate logical interfaces, allowing for the routing and processing of traffic between different VLANs.

Best regards
.ı|ı.ı|ı. If This Helps, Please Rate .ı|ı.ı|ı.

View solution in original post

3 Replies 3

Encapsulation dot1q 10 

this vlan-id need to match what you config in SW in vlan database and vlan allow in trunk 



SW
vlan 10 
interface fax/x <<- interface connect to router 
switchport mode trunk 
switchport trunk allow vlan 10

R
interface fa0/0.1000 <<- not matter 
encapsulation dot1q 10 <<- must match VLAN-ID in SW
ip add x.x.x.x mask 

The subinterface of

g0/0.10

does not have to match but it is helpful for identifying which subinterface belongs to which VLAN. You only have 1 in your example but imagine a network with 10 or 20 subinterfaces. As @MHM Cisco World pointed out the encapsulation number has to match the VLAN youre trying to match becasue its telling the router that wehn you send traffic on this subinterface encapsulate it with the VLAN # tag so when the switch on the other side receives it on its trunk port it knows which VLAN it belongs to and can switch the frames accordingly.

-David

M02@rt37
VIP
VIP

Hello @Sinosha,

When a router receives a frame with a

 dot1q

header, it uses the information in the header to determine which subinterface should handle the frame.

The

 dot1q 

header contains a VLAN tag that specifies the VLAN ID of the traffic. The router examines this VLAN tag to determine which subinterface is associated with that VLAN. The router compares the VLAN ID in the

 dot1q

header with the VLAN IDs configured on its subinterfaces. If there is a match, the router forwards the frame to the corresponding subinterface.

Each subinterface is configured with a specific VLAN ID using the Encapsulation

 dot1q 

command. This VLAN ID is used as a filter to determine which frames should be accepted by the subinterface. Frames that arrive with a matching VLAN tag are forwarded to the corresponding subinterface, and frames with a different VLAN tag are typically dropped or handled according to the router's configuration.

By associating a VLAN ID with a subinterface, the router can distinguish between different VLANs and treat them as separate logical interfaces, allowing for the routing and processing of traffic between different VLANs.

Best regards
.ı|ı.ı|ı. If This Helps, Please Rate .ı|ı.ı|ı.