Cant ping switch over trunk port

Cant ping switch over trunk port

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
!

Cant ping switch over trunk port

Ron Maupin

94.8k25 gold badges109 silver badges184 bronze badges

asked Apr 17, 2018 at 8:40

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
!

answered Apr 17, 2018 at 10:39

Cant ping switch over trunk port

Ron MaupinRon Maupin

94.8k25 gold badges109 silver badges184 bronze badges

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.

answered Apr 17, 2018 at 9:44

Abu ZaidAbu Zaid

3612 silver badges6 bronze badges

So I have configurable switch, two pc (1st PC is on VLAN 101, 2nd PC is on VLAN 102) and a router that is on VLAN 103.

VLAN 103 (named as router) is in trunk mode.

switchport mode trunk
switchport trunk allow vlan 102,103

VLAN 101(pirmas) VLAN 102(antras) is in access mode

switchport mode access
switchport access vlan 101 / vlan 102

But still I can't ping from VLAN 103 to VLAN101 102 and vica versa, even if its trunked. Here is is the scheme:

Cant ping switch over trunk port

Can you tell me what I'm doing wrong?

Posted Sep 18, 2020 08:01 AM

I agree it can be confusing, and that has mostly to do with trunk/access port on other products.

If you need to pass multiple VLANs on a port, you will need to add VLAN tags to the traffic, and the other side needs the take the tags off again and process it for the different VLANs.

On a port you can have multiple tagged VLANs, and/or one untagged VLAN. In most products for a link between switches to carry VLAN 10-19, you would do something like:

interface gigabit 48
  switchport mode trunk
  trunk allowed-vlan 10-19

If you have port 10 to connect a printer in vlan 12, that would be:

interface gigabit 10
  switchport mode access
  access vlan 12

The first will apply VLAN tags to the vlans 10-19, so the AOS Switch configuration to put the vlans on port 48 would be:

vlan 10-19
  tagged 48

The second, to connect a device that needs to be in vlan 12 on port 10:

vlan 12 untagged 10

Technically there is not really a difference in mode between access ports and trunk ports, so thinking in tagged (to other switches) and untagged (to computers, printers, etc.) is more accurate. But most important is that the terminology is just different.

Then if you have the 'native vlan' on a switch that works with 'mode trunk', it will put the native vlan traffic as untagged on the wire. See the following configuration equivalents:

interface gigabit 48
  switchport mode trunk
  trunk native vlan 5
  trunk allowed-vlan 10-19
vlan 5
  untagged 48
vlan 10-19
  tagged 48

How do you check a trunk port on a switch?

Use the show interfaces trunk command to check whether the local and peer native VLANs match. If the native VLAN does not match on both sides, VLAN leaking occurs. Use the show interfaces trunk command to check whether a trunk has been established between switches. Statically configure trunk links whenever possible.

How do I enable VLAN on trunk port?

perform these steps:.
To restrict the traffic that a trunk carries, issue the switchport trunk vlan-list interface configuration command. ... .
To add a VLAN to the trunk, issue the switchport trunk allowed vlan add vlan-list command..
This example shows how to remove VLANs 5 through 10 and 12..

How do you port a trunk port to a switch?

To enable trunk links, configure the ports on either end of the physical link with parallel sets of commands. To configure a switch port on one end of a trunk link, use the switchport mode trunk command. With this command, the interface changes to permanent trunking mode.

Do trunk ports need IP address?

The router needs to have an IP address/mask associated with each VLAN on the trunk. However, the router has only one physical interface for the link connected to the trunk.