无法在路由器和分布交换机之间建立中继以成功

网络工程 路由 局域网 交换 树干 数据包跟踪器
2022-02-05 06:14:43

在此处输入图像描述 我无法从路由器成功 ping 到分布交换机

                       Distribution Switch

Dist_Switch#sh ru
Dist_Switch#sh running-config 
Building configuration...

Current configuration : 4493 bytes
!
version 12.2
no service timestamps log datetime msec
no service timestamps debug datetime msec
service password-encryption
!
hostname Dist_Switch
!
!
!
no ip domain-lookup
ip domain-name 19HyperMarket_Sdn._Bhd.
!
username adam secret 5 $1$mERr$4dpRATIgxQacPVK0CfNV4/
!
!
spanning-tree mode pvst
spanning-tree vlan 10,20,30,40,50,99 priority 24576
!
interface Port-channel 1
 switchport trunk native vlan 99
 switchport mode trunk
!
interface Port-channel 4
 switchport trunk native vlan 99
 switchport mode trunk
!
interface FastEthernet0/1
 description Connection to Switch1
 switchport trunk native vlan 99
 switchport mode trunk
 channel-group 1 mode desirable
!
interface FastEthernet0/2
 description Connection to Switch1
 switchport trunk native vlan 99
 switchport mode trunk
 channel-group 1 mode desirable
!
interface FastEthernet0/3
 description Connection to Switch3
 switchport trunk native vlan 99
 switchport mode trunk
 channel-group 4 mode desirable
!
interface FastEthernet0/4
 description Connection to Switch3
 switchport trunk native vlan 99
 switchport mode trunk
 channel-group 4 mode desirable
!
interface FastEthernet0/5
 description These ports have been disabled
 shutdown
!
interface FastEthernet0/6
 description These ports have been disabled
 shutdown
!
interface FastEthernet0/7
 description These ports have been disabled
 shutdown
!
interface FastEthernet0/8
 description These ports have been disabled
 shutdown
!
interface FastEthernet0/9
 description These ports have been disabled
 shutdown
!
interface FastEthernet0/10
 description These ports have been disabled
 shutdown
!
interface FastEthernet0/11
 description These ports have been disabled
 shutdown
!
interface FastEthernet0/12
 description These ports have been disabled
 shutdown
!
interface FastEthernet0/13
 description These ports have been disabled
 shutdown
!
interface FastEthernet0/14
 description These ports have been disabled
 shutdown
!
interface FastEthernet0/15
 description These ports have been disabled
 shutdown
!
interface FastEthernet0/16
 description These ports have been disabled
 shutdown
!
interface FastEthernet0/17
 description These ports have been disabled
 shutdown
!
interface FastEthernet0/18
 description These ports have been disabled
 shutdown
!
interface FastEthernet0/19
 description These ports have been disabled
 shutdown
!
interface FastEthernet0/20
 description These ports have been disabled
 shutdown
!
interface FastEthernet0/21
 description These ports have been disabled
 shutdown
!
interface FastEthernet0/22
 description These ports have been disabled
 shutdown
!
interface FastEthernet0/23
 description These ports have been disabled
 shutdown
!
interface FastEthernet0/24
 description These ports have been disabled
 shutdown
!
interface GigabitEthernet0/1
 switchport mode trunk
!
interface GigabitEthernet0/2
 shutdown
!
interface Vlan1
 no ip address
 shutdown
!
interface Vlan99
 description Management Department Network
 mac-address 00e0.8fd5.2b01
 ip address 172.22.129.162 255.255.255.240
!
ip default-gateway 172.22.129.161
!
banner motd ^C

^C
!
!
!
line con 0
 logging synchronous
 login local
!
line vty 0 4
 login local
 transport input ssh
line vty 5 15
 login local
 transport input ssh
!
!
!
end
==================================================================================
                               Router
Router0#sh ru
Building configuration...

Current configuration : 3075 bytes
!
version 15.1
no service timestamps log datetime msec
no service timestamps debug datetime msec
service password-encryption
!
hostname Router0
!
!
!
enable secret 5 $1$mERr$4dpRATIgxQacPVK0CfNV4/
!
!
!
!
!
!
no ip cef
no ipv6 cef
!
!
!
username adam privilege 15 secret 5 $1$mERr$4dpRATIgxQacPVK0CfNV4/
!
!
license udi pid CISCO2901/K9 sn FTX1524B6P2
!
!
!
!
!
!
!
!
!
no ip domain-lookup
ip domain-name 19HyperMarket_Sdn._Bhd.
!
!
spanning-tree mode pvst
!
!
!
!
!
!
interface Loopback0
 ip address 1.1.1.1 255.255.255.0
!
interface GigabitEthernet0/0
 description Local Network Link
 no ip address
 duplex auto
 speed auto
!
interface GigabitEthernet0/0.10
 description Connection to Sales VLAN
 encapsulation dot1Q 10
 ip address 172.22.128.1 255.255.255.0
!
interface GigabitEthernet0/0.20
 description Connection to Finance VLAN
 encapsulation dot1Q 20
 ip address 172.22.129.1 255.255.255.192
!
interface GigabitEthernet0/0.30
 description Connection to Admin VLAN
 encapsulation dot1Q 30
 ip address 172.22.129.65 255.255.255.224
!
interface GigabitEthernet0/0.40
 description Connection to IT VLAN
 encapsulation dot1Q 40
 ip address 172.22.129.97 255.255.255.224
!
interface GigabitEthernet0/0.50
 description Connection to Inventory & Delivery VLAN
 encapsulation dot1Q 50
 ip address 172.22.129.129 255.255.255.224
!
interface GigabitEthernet0/0.99
 description Connection to Management VLAN
 encapsulation dot1Q 99 native
 ip address 172.22.129.161 255.255.255.240
!
interface GigabitEthernet0/1
 no ip address
 duplex auto
 speed auto
 shutdown
!
interface Vlan1
 no ip address
 shutdown
!
ip classless
!
ip flow-export version 9
!
!
!
banner motd ^C


^C
!
!
!
!
line con 0
 logging synchronous
 login local
!
line aux 0
!
line vty 0 4
 login local
 transport input ssh
line vty 5 15
 login local
 transport input ssh
!
!
!
end
1个回答

这是因为 Router (g0/0, g0/0.99) 和 Dist_Switch (g0/1) 之间的本地 vlan 不匹配:

Dist_Switch#
interface GigabitEthernet0/1
 switchport mode trunk

Router0#
interface GigabitEthernet0/0.99
 description Connection to Management VLAN
 encapsulation dot1Q 99 native
 ip address 172.22.129.161 255.255.255.240

要解决此问题,您应该将 Dist_Switch 上的 G0/1 配置为中继特定 VLAN 和 VLAN 99 作为本地 VLAN:

Dist_Switch#
 interface GigabitEthernet0/1
  switchport trunk native vlan 99
  switchport trunk allowed vlan 10,20,30,40,50,99
  switchport mode trunk