局域网ping不通?

网络工程 思科 路由 IPv4 网络 交换
2022-02-20 20:20:17
    Current configuration : 2695 bytes
    !
    version 15.1
    no service timestamps log datetime msec
    no service timestamps debug datetime msec
    service password-encryption
    !
    hostname RoUtEr
    !
    login block-for 120 attempts 5 within 360
    !
    !
    enable secret 5 $1$mERr$hx5rVt7rPNoS4wqbXKX7m0
    !
    !
    !
    ip dhcp pool Financa
     network 192.168.10.0 255.255.255.0
     default-router 192.168.10.1
     dns-server 8.8.8.8
    !
    !
    !
    no ip cef
    no ipv6 cef
    !
    !
    !
    username admin secret 5 $1$mERr$hx5rVt7rPNoS4wqbXKX7m0
    !
    !
    license udi pid CISCO1941/K9 sn FTX15247LE2-
    !
    !
    !
    !
    !
    !
    !
    !
    !
    ip ssh version 2
    no ip domain-lookup
    ip domain-name ccna.com
    !
    !
    spanning-tree mode pvst
    !
    !
    !
    !
    !
    !
    interface GigabitEthernet0/0
     no ip address
     ip helper-address 192.168.20.10
     ip nat inside
     duplex auto
     speed auto
    !
    interface GigabitEthernet0/0.10
     description Financa
     encapsulation dot1Q 10
     ip address 192.168.10.1 255.255.255.0
    !
    interface GigabitEthernet0/0.20
     description WorkStation
     encapsulation dot1Q 20
     ip address 192.168.20.1 255.255.255.0
    !
    interface GigabitEthernet0/0.30
     description WorkStation 2
     encapsulation dot1Q 30
     ip address 192.168.30.1 255.255.255.0
    !
    interface GigabitEthernet0/0.40
     description Phone
     encapsulation dot1Q 40
     ip address 192.168.40.1 255.255.255.0
    !
    interface GigabitEthernet0/0.50
     description CameraRoom
     encapsulation dot1Q 50
     ip address 192.168.50.1 255.255.255.0
    !
    interface GigabitEthernet0/0.99
     description Native
     encapsulation dot1Q 99 native
     no ip address
    !
    interface GigabitEthernet0/0.100
     description MGM
     encapsulation dot1Q 100
     ip address 192.168.100.1 255.255.255.0
    !
    interface GigabitEthernet0/1
     no ip address
     duplex auto
     speed auto
     shutdown
    !
    interface Serial0/0/0
     no ip address
     ip nat outside
     clock rate 2000000
     shutdown
    !
    interface Serial0/0/1
     no ip address
     ip nat outside
     clock rate 2000000
     shutdown
    !
    interface Serial0/1/0
     no ip address
     clock rate 2000000
     shutdown
    !
    interface Serial0/1/1
     no ip address
     clock rate 2000000
     shutdown
    !
    interface Vlan1
     no ip address
     shutdown
    !
    ip nat inside source list 1 interface Serial0/0/0 overload
    ip classless
    ip route 0.0.0.0 0.0.0.0 Serial0/0/0 
    ip route 0.0.0.0 0.0.0.0 Serial0/0/1 10
    !
    ip flow-export version 9
    !
    !
    ip access-list extended sl_def_acl
     deny tcp any any eq telnet
     deny tcp any any eq www
     deny tcp any any eq 22
     permit tcp any any eq 22
    access-list 1 permit 192.168.0.0 0.0.127.255
    !
    no cdp run
    !
    banner motd ^CAuthorized Only^C
    !
    !
    !
    !
    !
    line con 0
     exec-timeout 5 0
     password 7 0822455D0A16
     login
    !
    line aux 0
     password 7 0822455D0A16
     login
    !
    line vty 0 4
     exec-timeout 5 0
     password 7 0822455D0A16
     login local
     transport input ssh
    line vty 5 15
     exec-timeout 5 0
     password 7 0822455D0A16
     login local
     transport input ssh
    !
    !
    !
    end
    
    
  
    

开关 1

  spanning-tree mode rapid-pvst
    spanning-tree extend system-id
    !
    interface FastEthernet0/1
    !
    interface FastEthernet0/2
     switchport trunk native vlan 99
     switchport trunk allowed vlan 10,20,30,40,50,99-100
     switchport mode trunk
     switchport nonegotiate
    !
    interface FastEthernet0/3
     switchport access vlan 20
     switchport mode access
     switchport port-security maximum 2
     switchport port-security mac-address sticky 
    !
    interface FastEthernet0/4
    !
    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
     switchport access vlan 20
     switchport mode access
     switchport voice vlan 40
     switchport port-security maximum 2
     switchport port-security mac-address sticky 
    !
    interface FastEthernet0/21
     switchport access vlan 20
     switchport mode access
     switchport port-security maximum 5
     switchport port-security mac-address sticky 
     switchport port-security aging time 10
    !
    interface FastEthernet0/22
     switchport access vlan 20
     switchport mode access
     switchport port-security maximum 5
     switchport port-security mac-address sticky 
     switchport port-security aging time 10
    !
    interface FastEthernet0/23
     switchport access vlan 50
     switchport mode access
     switchport port-security
     switchport port-security maximum 2
     switchport port-security mac-address sticky 
     switchport port-security mac-address sticky 0060.3EBC.AD37
     switchport port-security aging time 10
    !
    interface FastEthernet0/24
     switchport access vlan 50
     switchport mode access
     switchport port-security
     switchport port-security maximum 2
     switchport port-security mac-address sticky 
     switchport port-security mac-address sticky 00E0.8FA1.5C2E
     switchport port-security aging time 10
    !
    interface GigabitEthernet0/1
     switchport trunk native vlan 99
     switchport trunk allowed vlan 10,20,30,40,50,99-100
     switchport mode trunk
     switchport nonegotiate
    !
    interface GigabitEthernet0/2
    !
    interface Vlan1
     no ip address
     shutdown
    !
    interface Vlan100
     ip address 192.168.100.2 255.255.255.0
    !
    ip default-gateway 192.168.100.1
    !
    banner motd ^CAuthorized Only^C
    !
    !
    !
    line con 0
     password 7 0822455D0A16
     login
    !
    line vty 0 4
     password 7 0822455D0A16
     login local
     transport input ssh
    line vty 5 15
     password 7 0822455D0A16
     login local
     transport input ssh
    !
    !
    !
    !
    end


S1#

开关2

Current configuration : 1998 bytes
!
version 15.0
no service timestamps log datetime msec
no service timestamps debug datetime msec
service password-encryption
!
hostname S2
!
enable secret 5 $1$mERr$hx5rVt7rPNoS4wqbXKX7m0
!
!
!
ip ssh version 2
no ip domain-lookup
ip domain-name ccna.com
!
username admin secret 5 $1$mERr$hx5rVt7rPNoS4wqbXKX7m0
!
!
!
spanning-tree mode pvst
spanning-tree extend system-id
!
interface FastEthernet0/1
!
interface FastEthernet0/2
 switchport trunk native vlan 99
 switchport trunk allowed vlan 10,20,30,40,50,99-100
 switchport mode trunk
 switchport nonegotiate
!
interface FastEthernet0/3
 switchport trunk native vlan 99
 switchport trunk allowed vlan 10,20,30,40,50,99-100
 switchport mode trunk
 switchport nonegotiate
!
interface FastEthernet0/4
!
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
 switchport access vlan 30
 switchport mode access
 switchport voice vlan 40
!
interface FastEthernet0/23
 switchport access vlan 30
 switchport mode access
 switchport voice vlan 40
!
interface FastEthernet0/24
 switchport access vlan 30
 switchport mode access
 switchport voice vlan 40
!
interface GigabitEthernet0/1
!
interface GigabitEthernet0/2
!
interface Vlan1
 no ip address
 shutdown
!
interface Vlan100
 ip address 192.168.100.3 255.255.255.0
!
ip default-gateway 192.168.100.1
!
banner motd ^CAuthorized Only^C
!
!
!
line con 0
 password 7 0822455D0A16
 login
!
line vty 0 4
 password 7 0822455D0A16
 login local
 transport input ssh
line vty 5 15
 password 7 0822455D0A16
 login local
 transport input ssh
!
!
!
!
end

  

开关 3

 version 15.0
    no service timestamps log datetime msec
    no service timestamps debug datetime msec
    service password-encryption
    !
    hostname S3
    !
    enable secret 5 $1$mERr$hx5rVt7rPNoS4wqbXKX7m0
    !
    !
    !
    ip ssh version 2
    no ip domain-lookup
    ip domain-name ccna.com
    !
    username admin secret 5 $1$mERr$hx5rVt7rPNoS4wqbXKX7m0
    !
    !
    !
    spanning-tree mode rapid-pvst
    spanning-tree extend system-id
    !
    interface FastEthernet0/1
    !
    interface FastEthernet0/2
    !
    interface FastEthernet0/3
     switchport trunk native vlan 99
     switchport trunk allowed vlan 10,20,30,40,50,99-100
     switchport mode trunk
     switchport nonegotiate
    !
    interface FastEthernet0/4
    !
    interface FastEthernet0/5
    !
    interface FastEthernet0/6
    !
    interface FastEthernet0/7
    !
    interface FastEthernet0/8
    !
    interface FastEthernet0/9
    !
    interface FastEthernet0/10
     switchport access vlan 100
     switchport mode access
     switchport port-security mac-address 0000.0CC3.26DD
    !
    interface FastEthernet0/11
    !
    interface FastEthernet0/12
    !
    interface FastEthernet0/13
    !
    interface FastEthernet0/14
    !
    interface FastEthernet0/15
     switchport access vlan 10
     switchport mode access
     switchport port-security
     switchport port-security maximum 5
     switchport port-security mac-address sticky 
    !
    interface FastEthernet0/16
     switchport access vlan 10
     switchport mode access
     switchport port-security
     switchport port-security maximum 5
     switchport port-security mac-address sticky 
    !
    interface FastEthernet0/17
     switchport access vlan 10
     switchport mode access
     switchport port-security
     switchport port-security maximum 5
     switchport port-security mac-address sticky 
    !
    interface FastEthernet0/18
     switchport access vlan 10
     switchport mode access
     switchport port-security
     switchport port-security maximum 5
     switchport port-security mac-address sticky 
    !
    interface FastEthernet0/19
     switchport access vlan 10
     switchport mode access
     switchport port-security
     switchport port-security maximum 5
     switchport port-security mac-address sticky 
    !
    interface FastEthernet0/20
     switchport access vlan 10
     switchport mode access
     switchport port-security
     switchport port-security maximum 5
     switchport port-security mac-address sticky 
     switchport port-security mac-address sticky 0090.2B84.C7E4
    !
    interface FastEthernet0/21
     switchport access vlan 10
     switchport mode access
     switchport port-security
     switchport port-security maximum 5
     switchport port-security mac-address sticky 
    !
    interface FastEthernet0/22
     switchport access vlan 10
     switchport mode access
     switchport port-security
     switchport port-security maximum 5
     switchport port-security mac-address sticky 
    !
    interface FastEthernet0/23
     switchport access vlan 10
     switchport mode access
     switchport port-security
     switchport port-security maximum 5
     switchport port-security mac-address sticky 
    !
    interface FastEthernet0/24
     switchport access vlan 10
     switchport mode access
     switchport port-security
     switchport port-security maximum 5
     switchport port-security mac-address sticky 
    !
    interface GigabitEthernet0/1
    !
    interface GigabitEthernet0/2
    !
    interface Vlan1
     no ip address
     shutdown
    !
    interface Vlan100
     ip address 192.168.100.4 255.255.255.0
    !
    ip default-gateway 192.168.100.1
    !
    banner motd ^CAuthorized Only^C
    !
    !
    !
    line con 0
     password 7 0822455D0A16
     login
    !
    line vty 0 4
     password 7 0822455D0A16
     login local
     transport input ssh
    line vty 5 15
     password 7 0822455D0A16
     login local
     transport input ssh
    !
    !
    !
    !
    end

在此处输入图像描述

开关1

 S1#show spanning-tree vlan 10,20,30,40,50,99,100
VLAN0020
  Spanning tree enabled protocol rstp
  Root ID    Priority    32788
             Address     0002.1775.D22D
             This bridge is the root
             Hello Time  2 sec  Max Age 20 sec  Forward Delay 15 sec

  Bridge ID  Priority    32788  (priority 32768 sys-id-ext 20)
             Address     0002.1775.D22D
             Hello Time  2 sec  Max Age 20 sec  Forward Delay 15 sec
             Aging Time  20

Interface        Role Sts Cost      Prio.Nbr Type
---------------- ---- --- --------- -------- --------------------------------
Fa0/2            Desg FWD 19        128.2    P2p
Fa0/3            Desg FWD 19        128.3    P2p
Fa0/20           Desg FWD 19        128.20   P2p
Fa0/21           Desg FWD 19        128.21   P2p
Fa0/22           Desg FWD 19        128.22   P2p
Gi0/1            Desg FWD 4         128.25   P2p

VLAN0040
  Spanning tree enabled protocol rstp
  Root ID    Priority    32808
             Address     0002.1775.D22D
             This bridge is the root
             Hello Time  2 sec  Max Age 20 sec  Forward Delay 15 sec

  Bridge ID  Priority    32808  (priority 32768 sys-id-ext 40)
             Address     0002.1775.D22D
             Hello Time  2 sec  Max Age 20 sec  Forward Delay 15 sec
             Aging Time  20

Interface        Role Sts Cost      Prio.Nbr Type
---------------- ---- --- --------- -------- --------------------------------
Fa0/2            Desg FWD 19        128.2    P2p
Fa0/20           Desg FWD 19        128.20   P2p
Gi0/1            Desg FWD 4         128.25   P2p

VLAN0050
  Spanning tree enabled protocol rstp
  Root ID    Priority    32818
             Address     0002.1775.D22D
             This bridge is the root
             Hello Time  2 sec  Max Age 20 sec  Forward Delay 15 sec

  Bridge ID  Priority    32818  (priority 32768 sys-id-ext 50)
             Address     0002.1775.D22D
             Hello Time  2 sec  Max Age 20 sec  Forward Delay 15 sec
             Aging Time  20

Interface        Role Sts Cost      Prio.Nbr Type
---------------- ---- --- --------- -------- --------------------------------
Fa0/2            Desg FWD 19        128.2    P2p
Fa0/23           Desg FWD 19        128.23   P2p
Fa0/24           Desg FWD 19        128.24   P2p
Gi0/1            Desg FWD 4         128.25   P2p

VLAN0099
  Spanning tree enabled protocol rstp
  Root ID    Priority    32867
             Address     0002.1775.D22D
             This bridge is the root
             Hello Time  2 sec  Max Age 20 sec  Forward Delay 15 sec

  Bridge ID  Priority    32867  (priority 32768 sys-id-ext 99)
             Address     0002.1775.D22D
             Hello Time  2 sec  Max Age 20 sec  Forward Delay 15 sec
             Aging Time  20

Interface        Role Sts Cost      Prio.Nbr Type
---------------- ---- --- --------- -------- --------------------------------
Fa0/2            Desg FWD 19        128.2    P2p
Gi0/1            Desg FWD 4         128.25   P2p

VLAN0100
  Spanning tree enabled protocol rstp
  Root ID    Priority    32868
             Address     0002.1775.D22D
             This bridge is the root
             Hello Time  2 sec  Max Age 20 sec  Forward Delay 15 sec

  Bridge ID  Priority    32868  (priority 32768 sys-id-ext 100)
             Address     0002.1775.D22D
             Hello Time  2 sec  Max Age 20 sec  Forward Delay 15 sec
             Aging Time  20

Interface        Role Sts Cost      Prio.Nbr Type
---------------- ---- --- --------- -------- --------------------------------
Fa0/2            Desg FWD 19        128.2    P2p
Gi0/1            Desg FWD 4         128.25   P2p

SW2

S2#show spanning-tree  vlan 10,20,30,40,50,99,100
VLAN0030
  Spanning tree enabled protocol ieee
  Root ID    Priority    32798
             Address     0060.4774.2C6A
             This bridge is the root
             Hello Time  2 sec  Max Age 20 sec  Forward Delay 15 sec

  Bridge ID  Priority    32798  (priority 32768 sys-id-ext 30)
             Address     0060.4774.2C6A
             Hello Time  2 sec  Max Age 20 sec  Forward Delay 15 sec
             Aging Time  20

Interface        Role Sts Cost      Prio.Nbr Type
---------------- ---- --- --------- -------- --------------------------------
Fa0/23           Desg FWD 19        128.23   P2p
Fa0/22           Desg FWD 19        128.22   P2p
Fa0/24           Desg FWD 19        128.24   P2p
Fa0/2            Desg FWD 19        128.2    P2p
Fa0/3            Desg FWD 19        128.3    P2p

VLAN0040
  Spanning tree enabled protocol ieee
  Root ID    Priority    32808
             Address     0002.1775.D22D
             Cost        19
             Port        2(FastEthernet0/2)
             Hello Time  2 sec  Max Age 20 sec  Forward Delay 15 sec

  Bridge ID  Priority    32808  (priority 32768 sys-id-ext 40)
             Address     0060.4774.2C6A
             Hello Time  2 sec  Max Age 20 sec  Forward Delay 15 sec
             Aging Time  20

Interface        Role Sts Cost      Prio.Nbr Type
---------------- ---- --- --------- -------- --------------------------------
Fa0/23           Desg FWD 19        128.23   P2p
Fa0/22           Desg FWD 19        128.22   P2p
Fa0/24           Desg FWD 19        128.24   P2p
Fa0/2            Root FWD 19        128.2    P2p
Fa0/3            Desg FWD 19        128.3    P2p

VLAN0099
  Spanning tree enabled protocol ieee
  Root ID    Priority    32867
             Address     0002.1775.D22D
             Cost        19
             Port        2(FastEthernet0/2)
             Hello Time  2 sec  Max Age 20 sec  Forward Delay 15 sec

  Bridge ID  Priority    32867  (priority 32768 sys-id-ext 99)
             Address     0060.4774.2C6A
             Hello Time  2 sec  Max Age 20 sec  Forward Delay 15 sec
             Aging Time  20

Interface        Role Sts Cost      Prio.Nbr Type
---------------- ---- --- --------- -------- --------------------------------
Fa0/2            Root FWD 19        128.2    P2p
Fa0/3            Desg FWD 19        128.3    P2p

VLAN0100
  Spanning tree enabled protocol ieee
  Root ID    Priority    32868
             Address     0002.1775.D22D
             Cost        19
             Port        2(FastEthernet0/2)
             Hello Time  2 sec  Max Age 20 sec  Forward Delay 15 sec

  Bridge ID  Priority    32868  (priority 32768 sys-id-ext 100)
             Address     0060.4774.2C6A
             Hello Time  2 sec  Max Age 20 sec  Forward Delay 15 sec
             Aging Time  20

Interface        Role Sts Cost      Prio.Nbr Type
---------------- ---- --- --------- -------- --------------------------------
Fa0/2            Root FWD 19        128.2    P2p
Fa0/3            Desg FWD 19        128.3    P2p

SW3

S3#show spanning-tree vlan 10,20,30,40,50,99,100
VLAN0010
  Spanning tree enabled protocol rstp
  Root ID    Priority    32778
             Address     000A.41CC.655E
             This bridge is the root
             Hello Time  2 sec  Max Age 20 sec  Forward Delay 15 sec

  Bridge ID  Priority    32778  (priority 32768 sys-id-ext 10)
             Address     000A.41CC.655E
             Hello Time  2 sec  Max Age 20 sec  Forward Delay 15 sec
             Aging Time  20

Interface        Role Sts Cost      Prio.Nbr Type
---------------- ---- --- --------- -------- --------------------------------
Fa0/3            Desg FWD 19        128.3    P2p
Fa0/17           Desg FWD 19        128.17   P2p
Fa0/16           Desg FWD 19        128.16   P2p
Fa0/18           Desg FWD 19        128.18   P2p
Fa0/19           Desg FWD 19        128.19   P2p
Fa0/15           Desg FWD 19        128.15   P2p
Fa0/20           Desg FWD 19        128.20   P2p
Fa0/22           Desg FWD 19        128.22   P2p
Fa0/21           Desg FWD 19        128.21   P2p
Fa0/24           Desg FWD 19        128.24   P2p
Fa0/23           Desg FWD 19        128.23   P2p

VLAN0099
  Spanning tree enabled protocol rstp
  Root ID    Priority    32867
             Address     0002.1775.D22D
             Cost        38
             Port        3(FastEthernet0/3)
             Hello Time  2 sec  Max Age 20 sec  Forward Delay 15 sec

  Bridge ID  Priority    32867  (priority 32768 sys-id-ext 99)
             Address     000A.41CC.655E
             Hello Time  2 sec  Max Age 20 sec  Forward Delay 15 sec
             Aging Time  20

Interface        Role Sts Cost      Prio.Nbr Type
---------------- ---- --- --------- -------- --------------------------------
Fa0/3            Root FWD 19        128.3    P2p

VLAN0100
  Spanning tree enabled protocol rstp
  Root ID    Priority    32868
             Address     0002.1775.D22D
             Cost        38
             Port        3(FastEthernet0/3)
             Hello Time  2 sec  Max Age 20 sec  Forward Delay 15 sec

  Bridge ID  Priority    32868  (priority 32768 sys-id-ext 100)
             Address     000A.41CC.655E
             Hello Time  2 sec  Max Age 20 sec  Forward Delay 15 sec
             Aging Time  20

Interface        Role Sts Cost      Prio.Nbr Type
---------------- ---- --- --------- -------- --------------------------------
Fa0/3            Root FWD 19        128.3    P2p
Fa0/10           Desg FWD 19        128.10   P2p

S3#
1个回答

您的交换机上缺少 VLAN。例如,交换机 1 缺少 VLAN 10 和 30。其他交换机也缺少 VLAN。

然后您可以使用全局命令添加

Vlan 10
Name abc