cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
2112
Views
0
Helpful
7
Replies

Vlan,Etherchannel and trunking

paulsimounreyna
Level 1
Level 1

 

Hello guys I'm just new in networking industry and I'm trying to learn this Vlan with Etherchannel and trunking.

My problem is when i created VLAN10 and form an etherchannel between switch1 and switch2 then connected the router. I can ping the default gw of Vlan10 but when I added Vlan20 and setup a trunk between Switch2 and Router1 I can't ping Vlan10's default gw and can't ping PC1 and PC2.

 

Here is the code of switch2 and router1:

 

Switch2(config)#interface fa0/1

Switch2(config-if)#switchport trunk encapsulation dot1q

Switch2(config-if)#switchport mode trunk

 

Router1

 

Router(config-if)#interface fa0/0.10

Router(config-subif)#encapsulation dot1q 1

Router(config-subif)#ip address 192.168.1.1 255.255.255.0

Router(config-subif)#no shut

 

Hope you can help me with this one.

 

Thanks in advance 

1 Accepted Solution

Accepted Solutions

You would only use the "native" keyword on the subinterface if that vlan was also the native vlan on the trunk.

But if you look at the trunk port configuration it does not specify either of the vlans in use as the native vlan so if the OP does as you suggest it will actually stop it from working.

Jon

View solution in original post

7 Replies 7

Jon Marshall
Hall of Fame
Hall of Fame

Are you trying to do the inter vlan routing on the router ?

If so you need to modify the configuration -

1) when you use the "encapsulation dot1q <number>" the number must match the vlan number

2) you need a subinterface for each vlan on the router

3) then set the PCs to the corresponding subinterface IP on the router.

Jon

Yes Jon i did that but still for some reason the packets are not getting to PC 1 when i tried to ping from the router. It stuck on SW1. I just posted the codes i used for this network. Hope you can have it check to see where is my mistake. 

Thanks,

relia
Level 1
Level 1

As was stated the sub interface needs to match.  You will also need to define the native vlan.

Your example should read:

interface fa0/0.10

encapsulation dot1q 10 native

ip addr 192.168.1.1 255.255.255.0

no shut

 

 

 

You would only use the "native" keyword on the subinterface if that vlan was also the native vlan on the trunk.

But if you look at the trunk port configuration it does not specify either of the vlans in use as the native vlan so if the OP does as you suggest it will actually stop it from working.

Jon

I actually didn't specify the native Vlan so i by default Vlan 1 is still the native vlan so i guess that's not the problem. I posted my codes. Hope you have time to check it.

 

Thanks

paulsimounreyna
Level 1
Level 1

Hello guys,

I believe this has been my 4th day on this same problem but im not quitting on this one. I displayed the full code here. It seems that the problem is from the computer, and the switches. Packet can pass through from the router and switch 2 and got stocked in switch 1. Im out of luck figuring this out. Can you help me out analyzing this. Thanks guys for not quitting on me.

 

SWITCH 1

Switch>en
Switch#configure terminal
Enter configuration commands, one per line.  End with CNTL/Z.

Switch(config)#vlan 10
Switch(config-vlan)#name IT
Switch(config)#vlan 20
Switch(config-vlan)#name QA
Switch(config-vlan)#

Switch(config)#interface fa0/3
Switch(config-if)#switchport mode access
Switch(config-if)#switchport access vlan 10
Switch(config-if)#interface fa0/4
Switch(config-if)#switchport mode access
Switch(config-if)#switchport access vlan 20

Switch(config-if)#interface range fa0/1 - 2
Switch(config-if-range)#shutdown
Switch(config-if-range)#channel-protocol lacp
Switch(config-if-range)#channel-group 1 mode active
Switch(config-if-range)#
Creating a port-channel interface Port-channel 1
Switch(config-if-range)#exit

Switch(config)#interface port-channel 1
Switch(config-if)#switchport trunk encapsulation dot1q
Switch(config-if)#switchport mode trunk
Switch(config-if)#switchport trunk allowed vlan 1,10,20
Switch(config-if)#exit

Switch(config-if)#interface range fa0/1 - 2

Switch(config-if-range)#no shut

====================================================

SWITCH 2


Switch>en
Switch#configure terminal
Enter configuration commands, one per line.  End with CNTL/Z.
Switch(config)#interface range fa0/1 - 2
Switch(config-if-range)#channel-protocol lacp
Switch(config-if-range)#channel-group 1 mode active
Switch(config-if-range)#
Creating a port-channel interface Port-channel 1
Switch(config-if)#exit

Switch(config)#interface port-channel 1
Switch(config-if)#switchport trunk encapsulation dot1q
Switch(config-if)#switchport mode trunk
Switch(config-if)#switchport trunk allowed vlan 1,10,20
Switch(config-if)#exit

Switch(config)#interface fa0/3
Switch(config-if)#switchport trunk encapsulation dot1q
Switch(config-if)#switchport mode trunk

========================================================

ROUTER 1

Router>en
Router#configure terminal
Enter configuration commands, one per line.  End with CNTL/Z.
Router(config)#interface fa0/0
Router(config-if)#no shut

Router(config-if)#
%LINK-5-CHANGED: Interface FastEthernet0/0, changed state to up

%LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/0, changed state to up

Router(config-if)#interface fa0/0.10
Router(config-subif)#
%LINK-5-CHANGED: Interface FastEthernet0/0.10, changed state to up

%LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/0.10, changed state to up

Router(config-subif)#encapsulation dot1q 10
Router(config-subif)#ip address 192.168.10.1 255.255.255.0
Router(config-subif)#no shut
Router(config-subif)#interface fa0/0.20
Router(config-subif)#encapsulation dot1q 20
Router(config-subif)#ip address 192.168.20.1 255.255.255.0
Router(config-subif)#no shut
Router(config-subif)#

So the PCs are connected to SW1 which connects to SW2 with an etherchannel trunk and then SW2 connects to the router with a trunk port ?

1) from PC1 can it ping it's own default gateway 

2) if it can, can it ping the other vlan's default gateway

If this also works it suggests there may be firewalls on the PCs blocking inbound pings so check on the PCs.

3) if it can't can you post -

a) a "sh vlan brief" from both switches

b) a "sh int trunk" from both switches

Jon

Getting Started

Find answers to your questions by entering keywords or phrases in the Search bar above. New here? Use these resources to familiarize yourself with the community: