4

enter image description here

This is driving me nuts. There are 2 vlans on the switch( vlan 20 and 21.) one trunking port g0/1 and thats connected to a Router On A Stick. I CANT PING DIVINCES ON SEPARATE VLANS NOR THE ROUTER FROM THE PCs. HELP!!!!!

Interface configuration on the switch:

interface FastEthernet0/1
 switchport access vlan 21
 switchport mode access
 switchport nonegotiate
 spanning-tree portfast
!
interface FastEthernet0/2
 switchport access vlan 21
 switchport mode access
 switchport nonegotiate
 spanning-tree portfast
!
interface FastEthernet0/3
 switchport access vlan 20
 switchport mode access
 switchport nonegotiate
 spanning-tree portfast
!
interface FastEthernet0/4
 switchport access vlan 20
 switchport mode access
 switchport nonegotiate
 spanning-tree portfast


!
interface FastEthernet0/5
!
interface FastEthernet0/6
!
interface FastEthernet0/7
!
interface FastEthernet0/8
!
interface FastEthernet0/9
!
interface FastEthernet0/10
!
interface FastEthernet0/11
!
interface FastEthernet0/12
!
interface FastEthernet0/13
!
interface FastEthernet0/14
!
interface FastEthernet0/15
!
interface FastEthernet0/16
!
interface FastEthernet0/17
!
interface FastEthernet0/18
!
interface FastEthernet0/19
!
interface FastEthernet0/20
!
interface FastEthernet0/21
!
interface FastEthernet0/22
!
interface FastEthernet0/23
!
interface FastEthernet0/24
!
interface GigabitEthernet0/1
 switchport trunk allowed vlan 20-21
 switchport trunk encapsulation dot1q
!
interface GigabitEthernet0/2
!

Note the interface connecting switch to router( the one on the switch is gig 0/1)

configuration on router interface g0/0 as its the one connecting to the switch below

interface GigabitEthernet0/0
 no ip address
 duplex auto
 speed auto
!
interface GigabitEthernet0/0.20
 encapsulation dot1Q 20
 ip address 150.19.20.6 255.255.255.248
!
interface GigabitEthernet0/0.21
 encapsulation dot1Q 21
 ip address 150.19.21.6 255.255.255.248
!
2
  • If you can't even ping the router the VLANs are not set up correctly. You need to configure the VLAN trunk in exactly the same way on both sides.
    – Zac67
    Commented Apr 17, 2018 at 8:50
  • i swear i have... let me try to post the configuration on the switch
    – Frankline
    Commented Apr 17, 2018 at 8:57

2 Answers 2

2

I don't see where you have globally defined the VLANs on the switch. You need something like:

Vlan 20
 name VLAN_20   ! or whatever you want to name it
 exit
!
Vlan 21
 name VLAN_21   ! or whatever you want to name it
 exit
!
0
0

On the switch, add the following

interface GigabitEthernet0/1

switchport mode trunk

And then run show interface trunk to verify Trunk is setup properly on the Switch.

This site is temporarily in read-only mode and not accepting new answers.

Not the answer you're looking for? Browse other questions tagged .