2

I have a setup which requires two different VLANs to be able to ping one another. I have a setup with 2 - layer 2 switches and a router that has defined sub-interfaces, and for the life of me, I cannot find the error that is stopping the pinging between the PCs. (I cannot remove the switch that's between the router and the other switch due to other PCs going to be connected in the future)

I have tried multiple times to configure the Router on a stick, redoing the sub interfaces and trunking the ports between the equipment, but nothing works.

TL:DR - VLAN 50 cant ping VLAN 80, routing on a stick doesn't work

Thanks in advance

Diagram

Here is the running config for the router

Current configuration : 1545 bytes
!
version 15.1
no service timestamps log datetime msec
no service timestamps debug datetime msec
no service password-encryption
!
hostname Router
!
!
ip dhcp pool SERVICEPOOL
network 192.168.50.0 255.255.255.0
default-router 192.168.50.35
ip dhcp pool STUDENTPOOL
dns-server 8.8.8.8
domain-name STUDENTPOOL
ip dhcp pool ADMINPOOL
network 192.168.80.0 255.255.255.0
default-router 192.168.80.254
dns-server 8.8.8.8
!
!
no ip cef
no ipv6 cef
!
!
!
license udi pid CISCO2901/K9 sn FTX1524ETWG-
!
!
ip name-server 8.8.8.8
!
!
spanning-tree mode pvst
!
!
!
interface GigabitEthernet0/0
no ip address
duplex auto
speed auto
shutdown
!
interface GigabitEthernet0/1
ip address 192.168.10.1 255.255.255.0
duplex auto
speed auto
!
interface GigabitEthernet0/1.50
encapsulation dot1Q 50
ip address 192.168.50.1 255.255.255.0
!
interface GigabitEthernet0/1.80
encapsulation dot1Q 80
ip address 192.168.80.1 255.255.255.0
!
interface Serial0/0/0
ip address 192.168.127.9 255.255.255.252
clock rate 2000000
!
interface Serial0/0/1
no ip address
clock rate 2000000
shutdown
!
interface Vlan1
no ip address
shutdown
!
interface Vlan5
no ip address
!
interface Vlan50
no ip address
!
interface Vlan80
no ip address
!
interface Vlan99
ip address 192.168.99.1 255.255.255.0
!
router rip
version 2
passive-interface default
no passive-interface Vlan80
network 192.168.127.0
!
ip classless
!
ip flow-export version 9
!
no cdp run
!
!
line con 0
!
line aux 0
!
line vty 0 4
login
!
end

Here is Switch A running config

Current configuration : 2953 bytes
!
version 12.1
no service timestamps log datetime msec
no service timestamps debug datetime msec
no service password-encryption
!
hostname Switch
!
!
!
!
!
spanning-tree mode pvst
spanning-tree extend system-id
!
interface FastEthernet0/1
switchport access vlan 50
switchport trunk allowed vlan 1-99
switchport mode access
!
interface FastEthernet0/13
switchport access vlan 80
switchport trunk allowed vlan 1-99
switchport mode access
!
interface GigabitEthernet0/1
switchport access vlan 50
switchport trunk allowed vlan 1-99
switchport mode trunk
spanning-tree portfast trunk
!
interface GigabitEthernet0/2
switchport access vlan 32
switchport trunk allowed vlan 1-99
switchport mode trunk
!
interface Vlan1
ip address 192.168.99.3 255.255.255.0
shutdown
!
interface Vlan5
mac-address 0001.639c.ac61
no ip address
!
interface Vlan50
mac-address 0001.6312.8467
ip address 192.168.50.50 255.255.255.0
!
interface Vlan80
mac-address 0001.64d6.bbc8
ip address 192.168.80.5 255.255.255.0
!
interface Vlan99
mac-address 00e0.b008.e40a
ip address 192.168.99.3 255.255.255.0
!
ip default-gateway 192.168.10.1
!
!
!
line con 0
!
line vty 0 4
login
line vty 5 15
login
!
!
!
!
end

Here is switch B

Current configuration : 2905 bytes
!
version 12.1
no service timestamps log datetime msec
no service timestamps debug datetime msec
no service password-encryption
!
hostname Switch
!
!
!
!
!
spanning-tree mode pvst
spanning-tree extend system-id
!
interface FastEthernet0/1
switchport access vlan 50
switchport trunk allowed vlan 1-99
switchport mode trunk
!
interface FastEthernet0/13
switchport access vlan 80
switchport trunk allowed vlan 1-99
switchport mode trunk
!
interface GigabitEthernet0/1
switchport trunk allowed vlan 1-99
switchport mode trunk
!
interface GigabitEthernet0/2
switchport access vlan 32
switchport trunk allowed vlan 1-99
switchport mode trunk
!
interface Vlan1
ip address 192.168.99.40 255.255.255.0
!
interface Vlan32
mac-address 00d0.ba11.3e6d
no ip address
!
interface Vlan50
mac-address 000a.f35d.87d7
ip address 192.168.50.25 255.255.255.0
!
interface Vlan80
mac-address 000c.85c0.dcca
ip address 192.168.80.50 255.255.255.0
!
interface Vlan99
description SVI
mac-address 0090.21e6.1388
ip address 192.168.99.2 255.255.255.0
!
ip default-gateway 192.168.10.1
!
!
line con 0
!
line vty 0 4
login
line vty 5 15
login
!
!
end

and the 2 PCs enter image description here enter image description here

2
  • 3
    Can the PCs ping their default gateway? If not, make sure you have created the VLAN in both switches.
    – Ron Trunk
    Aug 26, 2019 at 12:22
  • Runs '(config)# vlan 50' and '(config)# vlan 80' in both switch.
    – Nakrule
    Aug 26, 2019 at 12:31

2 Answers 2

4

Configuration on your 1st and 2nd pc confirms that you have gateway setup incorrectly. Gateway for PC1 should be: 192.168.50.1 and gateway for PC2 should be 192.168.80.1

Also note that portfast should be turned on to end-host only (like PC) so it shouldn't be on Switch A port g0/1

Also computers shouldn't be connected as trunk interfaces since its only PC not switch or router your ports should be access ports on switch B ports fa0/13 and fa0/1

6
  • 1
    Also note that portfast should be turned on to end-host only (like PC) so it shouldn't be on Switch A port g0/1 is debatable. For routers I have complete control over (so I do know positively that that they won't do any bridging), I prefer and suggest running spanning-tree portfast [trunk] with spanning-tree bpduguard enable. The routing protocol (if given) will be quite happy not being left in black hole for 30seconds before eventually the switchport unblocks and starts forwarding routing protocol or FHRP hello packets Aug 26, 2019 at 13:20
  • Well if you don't want to wait for STP you can use rapid STP which is much faster :)
    – kubn2
    Aug 26, 2019 at 13:27
  • No, it's not, it's a common misconception about RSTP. RSTP and Rapid-PVST keep a non-portfast port in LRN state for 30 seconds, unless the connected device responds to the proposal by sending an agreement. Agreements however are only sent by RSTP bridges. Aug 26, 2019 at 15:15
  • It's not misconception you can make triangle in cisco packet tracer set all switches to rapid-pvst then just remove link and you can check how fast it will recover because:
    – kubn2
    Aug 26, 2019 at 21:17
  • "In the instance of a switch/link goes down any switch that has a link connected to it will notice (as its link has gone down) this switch will then bring up its alternative port and send out a BPDU to neighbour switches still alive to say it has done so. (so no timer need to time out, this happens almost instancley). this BPDU then travel through the network update all other switchs resulting in sub second fail over and convergence of the network."
    – kubn2
    Aug 26, 2019 at 21:17
1

To build upon Kubn2's response, there are several things you should reconfigure in this setup.

  1. The interfaces connecting PC1 and PC2 are set to trunk mode. You must remember that trunk is for Vlan traffic between switches, and is not for connecting end devices. You must therefor change these two ports to Access mode.

  2. The default gateway for a VLAN will be the IP Address set on your router subinterface. Therefor the two PC's must have the x.x.x.1 as their default address.

  3. I might be wrong on this one, but you have tagged IP Addresses on your switch. Generally I have been told that you should never implement IP Addresses on L2 switches since IP Address based traffic is Always handled by a L3 device, in this case your router.

As well as mentioned by Kubn2, Portfast should only be enabled on switches in your access layer. They are not used in the distribution layer of your setup.

3
  • Regarding point 3: its not true. Ip address on Vlan interface is nothing bad actually it is used for remote management via SSH/telnet.
    – kubn2
    Aug 26, 2019 at 13:30
  • @kubn2 ... or DHCP relay, or IGMP snooping, or SNMP, or ...
    – Zac67
    Aug 26, 2019 at 13:38
  • @kubn2 I was unsure about it. My teacher has just always told me that IP on L2 switching is a no no. But I totally forgot about SSH functionality.
    – Artic
    Aug 26, 2019 at 13:44

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.