cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
784
Views
4
Helpful
7
Replies

Subinterfaces error with two VLANs

Bruno Giorgio
Level 1
Level 1

Hi all,

I'm running Packet Tracer 8.2.1, and I have the following network. Two VLANs (VLAN4 and VLAN5), one Switch 2960, and one Router 1941. 

The VLAN networks are:

VLAN4 172.16.0.0/18   - PC IP 172.16.0.2  - Gateway 172.16.0.1

VLAN5 172.16.96.0/19 - PC IP 172.16.96.2 - Gateway 172.16.96.1

On the Switch, I have set as follows,

VLAN4 --> Fa0/x range 1 - 10  (the PC is connected to Fa0/1)

VLAN5 --> Fa0/x range 11-15  (the PC is connected to Fa0/11)

Screenshot from 2023-08-15 17-13-05.png

The Gig0/1 is the trunk connected to the Gig0/1 of the Router.

Screenshot from 2023-08-15 17-15-28.png

Now, on the Router I have set 2 subinterfaces with encapsulation dot1Q. No shutdown. 

Screenshot from 2023-08-15 17-17-01.png

Every time I try to ping one PC on VLAN4 to another PC on VLAN5, for example

ping 172.16.96.2

it failed and on the Router I have the following error message. 

"There is no subinterface with this vlan enabled"

Any idea about how to solve this?

Thanks in advance!

 

2 Accepted Solutions

Accepted Solutions

M02@rt37
VIP
VIP

Hello @Bruno Giorgio,

Please share subinterface config.

It should look like:

interface gig 0/1.10

encapsulation dot1q 4

ip address 172.16.0.1 mask

!

interface gig 0/1.20

encapsulation dot1q 5

ip address 172.16.96.1 mask
Best regards
.ı|ı.ı|ı. If This Helps, Please Rate .ı|ı.ı|ı.

View solution in original post

Encapsulation Vlan ID

is wrong for both

vlan 4 and 5

as interface ID does not matter but

encapsulation ID

does matter. Command

encapsulation dot1Q.x

will mark or assign all traffic to belong to

vlan x

Note that interface number does not have to match

encapsulation

number but makes sense when it does.

Change 10 to 4 and 20 to  5 like

interface GigabitEthernet0/1.4

encapsulation dot1Q 4


interface GigabitEthernet0/1.5


encapsulation dot1Q 5

 

Regards, ML
**Please Rate All Helpful Responses **

 

View solution in original post

7 Replies 7

balaji.bandi
Hall of Fame
Hall of Fame

how is your sub interface config look like. make sure PC FW also disabled.

check below config need to be done for the sub-interface :

https://networklessons.com/cisco/ccna-routing-switching-icnd1-100-105/how-to-configure-router-on-a-stick

BB

***** Rate All Helpful Responses *****

How to Ask The Cisco Community for Help

Martin L
VIP
VIP

Zip your lab PT file and attach it here

M02@rt37
VIP
VIP

Hello @Bruno Giorgio,

Please share subinterface config.

It should look like:

interface gig 0/1.10

encapsulation dot1q 4

ip address 172.16.0.1 mask

!

interface gig 0/1.20

encapsulation dot1q 5

ip address 172.16.96.1 mask
Best regards
.ı|ı.ı|ı. If This Helps, Please Rate .ı|ı.ı|ı.

Bruno Giorgio
Level 1
Level 1

Hi  balaji.bandi ,

Thank you, I will read your link and let you know.

Hi Martin L ,

Sure. Attached you'll find my lab file. 

Screenshot from 2023-08-15 17-56-36.png

Screenshot from 2023-08-15 17-56-14.png

Encapsulation Vlan ID

is wrong for both

vlan 4 and 5

as interface ID does not matter but

encapsulation ID

does matter. Command

encapsulation dot1Q.x

will mark or assign all traffic to belong to

vlan x

Note that interface number does not have to match

encapsulation

number but makes sense when it does.

Change 10 to 4 and 20 to  5 like

interface GigabitEthernet0/1.4

encapsulation dot1Q 4


interface GigabitEthernet0/1.5


encapsulation dot1Q 5

 

Regards, ML
**Please Rate All Helpful Responses **

 

Bruno Giorgio
Level 1
Level 1

You are great guys!

Thank you so much for your support!

You're very welcome @Bruno Giorgio.

Best regards
.ı|ı.ı|ı. If This Helps, Please Rate .ı|ı.ı|ı.
Review Cisco Networking for a $25 gift card