如何让 OSPF 查看通过千兆端口中继的 VLAN

网络工程 思科 局域网 ospf
2022-02-14 15:22:35

我对此比较陌生,我一直在尝试各种配置,但没有什么能抓住。我有三个路由器,有各种 vlan。vlan 正在工作。路由器使用 OSPF 互相访问。但是我无法让一侧的主机看到另一侧的主机。

我最初将所有链接都作为 /30 子网,但我不确定这是否正确。我尝试了其他人,但没有尝试检测到千兆位,所以我删除了它们

RIGHT {主机名 R3M

!
!
!
!
ip dhcp excluded-address 172.20.0.1
ip dhcp excluded-address 172.20.2.1
ip dhcp excluded-address 172.20.4.1
ip dhcp excluded-address 172.20.0.1 172.20.0.9
ip dhcp excluded-address 172.20.2.1 172.20.2.9
ip dhcp excluded-address 172.20.4.1 172.20.4.9
!
ip dhcp pool Consulting
 network 172.20.0.0 255.255.254.0
 default-router 172.20.0.1
ip dhcp pool HR
 network 172.20.2.0 255.255.254.0
 default-router 172.20.2.1
ip dhcp pool IT
 network 172.20.4.0 255.255.254.0
 default-router 172.20.4.1
!
!
!
ip cef
no ipv6 cef
!
!
!
!
license udi pid CISCO2901/K9 sn FTX15243FV0-
!
!
!
!
!
!
!
!
!
!
!
spanning-tree mode pvst
!
!
!
!
!
!
interface Loopback0
 ip address 1.1.1.1 255.255.255.255
!
interface GigabitEthernet0/0
 ip address 172.20.40.25 255.255.255.252
 duplex auto
 speed auto
!
interface GigabitEthernet0/0.15
 encapsulation dot1Q 15
 ip address 172.20.0.1 255.255.254.0
!
interface GigabitEthernet0/0.25
 encapsulation dot1Q 25
 ip address 172.20.2.1 255.255.254.0
!
interface GigabitEthernet0/0.35
 encapsulation dot1Q 35
 ip address 172.20.4.1 255.255.254.0
!
interface GigabitEthernet0/0.88
 encapsulation dot1Q 88
 ip address 172.20.6.1 255.255.255.128
!
interface GigabitEthernet0/0.90
 encapsulation dot1Q 90 native
 ip address 172.20.6.139 255.255.255.128
!
interface GigabitEthernet0/1
 no ip address
 duplex auto
 speed auto
 shutdown
!
interface Serial0/0/0
 ip address 172.20.20.1 255.255.255.252
!
interface Serial0/0/1
 ip address 172.20.20.6 255.255.255.252
 clock rate 64000
!
interface Serial0/1/0
 no ip address
 clock rate 64000
 shutdown
!
interface Serial0/1/1
 no ip address
 clock rate 64000
 shutdown
!
interface Vlan1
 no ip address
 shutdown
!
router ospf 1
 router-id 11.11.11.11
 log-adjacency-changes
 network 172.20.20.0 0.0.0.3 area 0
 network 172.20.20.4 0.0.0.3 area 0
!
ip classless
!
ip flow-export version 9
!
!
!
no cdp run
!
!
!
!
!
!
line con 0
!
line aux 0
!
line vty 0 4
 login
!
!
!
end}

{MS1#show 运行

Building configuration...

Current configuration : 5702 bytes
!
version 12.2
no service timestamps log datetime msec
no service timestamps debug datetime msec
no service password-encryption
!
hostname MS1
!
!
!
!
!
spanning-tree mode pvst
spanning-tree extend system-id
!
interface FastEthernet0/1
 switchport access vlan 15
 switchport mode access
 speed 100
 no cdp enable
 spanning-tree portfast
 spanning-tree bpduguard enable
 storm-control broadcast level 75
!
interface FastEthernet0/2
 switchport access vlan 25
 switchport mode access
 speed 100
 no cdp enable
 spanning-tree portfast
 spanning-tree bpduguard enable
 storm-control broadcast level 75
!
interface FastEthernet0/3
 switchport access vlan 35
 switchport mode access
 speed 100
 no cdp enable
 spanning-tree portfast
 spanning-tree bpduguard enable
 storm-control broadcast level 75
!
interface FastEthernet0/4
 switchport access vlan 88
 switchport mode access
 speed 100
 no cdp enable
 spanning-tree portfast
 spanning-tree bpduguard enable
 storm-control broadcast level 75
!
interface FastEthernet0/5
 switchport access vlan 15
 switchport mode access
 speed 100
 no cdp enable
 spanning-tree portfast
 spanning-tree bpduguard enable
 storm-control broadcast level 75
!
interface FastEthernet0/6
 switchport access vlan 25
 switchport mode access
 speed 100
 no cdp enable
 spanning-tree portfast
 spanning-tree bpduguard enable
 storm-control broadcast level 75
!
interface FastEthernet0/7
 switchport access vlan 35
 switchport mode access
 speed 100
 no cdp enable
 spanning-tree portfast
 spanning-tree bpduguard enable
 storm-control broadcast level 75
!
interface FastEthernet0/8
 switchport access vlan 11
 switchport mode access
 speed 100
 no cdp enable
 spanning-tree portfast
 spanning-tree bpduguard enable
 storm-control broadcast level 75
 shutdown
!
interface FastEthernet0/9
 switchport access vlan 11
 switchport mode access
 speed 100
 no cdp enable
 spanning-tree portfast
 spanning-tree bpduguard enable
 storm-control broadcast level 75
 shutdown
!
interface FastEthernet0/10
 switchport access vlan 11
 switchport mode access
 speed 100
 no cdp enable
 spanning-tree portfast
 spanning-tree bpduguard enable
 storm-control broadcast level 75
 shutdown
!
interface FastEthernet0/11
 switchport access vlan 11
 switchport mode access
 speed 100
 no cdp enable
 spanning-tree portfast
 spanning-tree bpduguard enable
 storm-control broadcast level 75
 shutdown
!
interface FastEthernet0/12
 switchport access vlan 11
 switchport mode access
 speed 100
 no cdp enable
 spanning-tree portfast
 spanning-tree bpduguard enable
 storm-control broadcast level 75
 shutdown
!
interface FastEthernet0/13
 switchport access vlan 11
 switchport mode access
 speed 100
 no cdp enable
 spanning-tree portfast
 spanning-tree bpduguard enable
 storm-control broadcast level 75
 shutdown
!
interface FastEthernet0/14
 switchport access vlan 11
 switchport mode access
 speed 100
 no cdp enable
 spanning-tree portfast
 spanning-tree bpduguard enable
 storm-control broadcast level 75
 shutdown
!
interface FastEthernet0/15
 switchport access vlan 11
 switchport mode access
 speed 100
 no cdp enable
 spanning-tree portfast
 spanning-tree bpduguard enable
 storm-control broadcast level 75
 shutdown
!
interface FastEthernet0/16
 switchport access vlan 11
 switchport mode access
 speed 100
 no cdp enable
 spanning-tree portfast
 spanning-tree bpduguard enable
 storm-control broadcast level 75
 shutdown
!
interface FastEthernet0/17
 switchport access vlan 11
 switchport mode access
 speed 100
 no cdp enable
 spanning-tree portfast
 spanning-tree bpduguard enable
 storm-control broadcast level 75
 shutdown
!
interface FastEthernet0/18
 switchport access vlan 11
 switchport mode access
 speed 100
 no cdp enable
 spanning-tree portfast
 spanning-tree bpduguard enable
 storm-control broadcast level 75
 shutdown
!
interface FastEthernet0/19
 switchport access vlan 11
 switchport mode access
 speed 100
 no cdp enable
 spanning-tree portfast
 spanning-tree bpduguard enable
 storm-control broadcast level 75
 shutdown
!
interface FastEthernet0/20
 switchport access vlan 11
 switchport mode access
 speed 100
 no cdp enable
 spanning-tree portfast
 spanning-tree bpduguard enable
 storm-control broadcast level 75
 shutdown
!
interface FastEthernet0/21
 switchport access vlan 11
 switchport mode access
 speed 100
 no cdp enable
 spanning-tree portfast
 spanning-tree bpduguard enable
 storm-control broadcast level 75
 shutdown
!
interface FastEthernet0/22
 switchport access vlan 11
 switchport mode access
 speed 100
 no cdp enable
 spanning-tree portfast
 spanning-tree bpduguard enable
 storm-control broadcast level 75
 shutdown
!
interface FastEthernet0/23
 switchport access vlan 11
 switchport mode access
 speed 100
 no cdp enable
 spanning-tree portfast
 spanning-tree bpduguard enable
 storm-control broadcast level 75
 shutdown
!
interface FastEthernet0/24
 switchport access vlan 11
 switchport mode access
 speed 100
 no cdp enable
 spanning-tree portfast
 spanning-tree bpduguard enable
 storm-control broadcast level 75
 shutdown
!
interface GigabitEthernet0/1
 description To Router
 switchport trunk native vlan 90
 switchport trunk allowed vlan 15,25,35,88,90
 switchport mode trunk
 switchport nonegotiate
 no cdp enable
!
interface GigabitEthernet0/2
 description Link to MS2
 switchport trunk native vlan 90
 switchport trunk allowed vlan 15,25,35,88,90
 switchport mode trunk
 switchport nonegotiate
 no cdp enable
!
interface Vlan1
 no ip address
 shutdown
!
interface Vlan88
 mac-address 00d0.9715.0d01
 ip address 172.20.6.10 255.255.255.128
!
ip default-gateway 172.20.6.1
!
!
!
!
line con 0
!
line vty 0 4
 login
line vty 5 15
 login
!
!
!
!
end

}

底部
{

R2L#show run
Building configuration...

Current configuration : 1968 bytes
!
version 15.1
no service timestamps log datetime msec
no service timestamps debug datetime msec
no service password-encryption
!
hostname R2L
!
!
!
!
ip dhcp excluded-address 172.20.8.1 172.20.8.9
ip dhcp excluded-address 172.20.10.1 172.20.10.9
ip dhcp excluded-address 172.20.12.1 172.20.12.9
!
ip dhcp pool Consulting
 network 172.20.8.0 255.255.254.0
 default-router 172.20.8.1
ip dhcp pool HR
 network 172.20.10.0 255.255.254.0
 default-router 172.20.10.1
ip dhcp pool IT
 network 172.20.12.0 255.255.254.0
 default-router 172.20.12.1
!
!
!
ip cef
no ipv6 cef
!
!
!
!
license udi pid CISCO2901/K9 sn FTX15246R9I-
!
!
!
!
!
!
!
!
!
!
!
spanning-tree mode pvst
!
!
!
!
!
!
interface Loopback0
 ip address 2.2.2.2 255.255.255.255
!
interface GigabitEthernet0/0
 ip address 172.20.20.29 255.255.255.252
 duplex auto
 speed auto
!
interface GigabitEthernet0/0.15
 encapsulation dot1Q 15
 ip address 172.20.8.1 255.255.254.0
!
interface GigabitEthernet0/0.25
 encapsulation dot1Q 25
 ip address 172.20.10.1 255.255.254.0
!
interface GigabitEthernet0/0.35
 encapsulation dot1Q 35
 ip address 172.20.12.1 255.255.254.0
!
interface GigabitEthernet0/0.88
 encapsulation dot1Q 88
 ip address 172.20.14.1 255.255.255.128
!
interface GigabitEthernet0/0.90
 encapsulation dot1Q 90
 no ip address
!
interface GigabitEthernet0/1
 no ip address
 duplex auto
 speed auto
 shutdown
!
interface Serial0/0/0
 ip address 172.20.20.2 255.255.255.252
 clock rate 64000
!
interface Serial0/0/1
 ip address 172.20.20.10 255.255.255.252
!
interface Serial0/1/0
 no ip address
 clock rate 64000
 shutdown
!
interface Serial0/1/1
 no ip address
 clock rate 64000
 shutdown
!
interface Vlan1
 no ip address
 shutdown
!
router ospf 1
 router-id 22.22.22.22
 log-adjacency-changes
 network 172.20.20.0 0.0.0.3 area 0
 network 172.20.20.8 0.0.0.3 area 0
!
router rip
!
ip classless
!
ip flow-export version 9
!
!
!
no cdp run
!
!
!
!
!
!
line con 0
!
line aux 0
!
line vty 0 4
 login
!
!
!
end}

{LS1#show 运行

Building configuration...

Current configuration : 5512 bytes
!
version 12.2
no service timestamps log datetime msec
no service timestamps debug datetime msec
no service password-encryption
!
hostname LS1
!
!
!
!
!
spanning-tree mode pvst
spanning-tree extend system-id
!
interface FastEthernet0/1
 switchport access vlan 15
 switchport mode access
 speed 100
 no cdp enable
 spanning-tree portfast
 spanning-tree bpduguard enable
 storm-control broadcast level 75
!
interface FastEthernet0/2
 switchport access vlan 25
 switchport mode access
 speed 100
 no cdp enable
 spanning-tree portfast
 spanning-tree bpduguard enable
 storm-control broadcast level 75
!
interface FastEthernet0/3
 switchport access vlan 35
 switchport mode access
 speed 100
 no cdp enable
 spanning-tree portfast
 spanning-tree bpduguard enable
 storm-control broadcast level 75
!
interface FastEthernet0/4
 switchport access vlan 88
 switchport mode access
 speed 100
 no cdp enable
 spanning-tree portfast
 spanning-tree bpduguard enable
 storm-control broadcast level 75
!
interface FastEthernet0/5
 switchport access vlan 15
 switchport mode access
 speed 100
 no cdp enable
 spanning-tree portfast
 spanning-tree bpduguard enable
 storm-control broadcast level 75
!
interface FastEthernet0/6
 switchport access vlan 25
 switchport mode access
 speed 100
 no cdp enable
 spanning-tree portfast
 spanning-tree bpduguard enable
 storm-control broadcast level 75
!
interface FastEthernet0/7
 switchport access vlan 35
 switchport mode access
 speed 100
 no cdp enable
 spanning-tree portfast
 spanning-tree bpduguard enable
 storm-control broadcast level 75
!
interface FastEthernet0/8
 switchport access vlan 11
 switchport mode access
 speed 100
 no cdp enable
 spanning-tree portfast
 spanning-tree bpduguard enable
 storm-control broadcast level 75
 shutdown
!
interface FastEthernet0/9
 switchport access vlan 11
 switchport mode access
 speed 100
 no cdp enable
 spanning-tree portfast
 spanning-tree bpduguard enable
 storm-control broadcast level 75
 shutdown
!
interface FastEthernet0/10
 switchport access vlan 11
 switchport mode access
 speed 100
 no cdp enable
 spanning-tree portfast
 spanning-tree bpduguard enable
 storm-control broadcast level 75
 shutdown
!
interface FastEthernet0/11
 switchport access vlan 11
 switchport mode access
 speed 100
 no cdp enable
 spanning-tree portfast
 spanning-tree bpduguard enable
 storm-control broadcast level 75
 shutdown
!
interface FastEthernet0/12
 switchport access vlan 11
 switchport mode access
 speed 100
 no cdp enable
 spanning-tree portfast
 spanning-tree bpduguard enable
 storm-control broadcast level 75
 shutdown
!
interface FastEthernet0/13
 switchport access vlan 11
 switchport mode access
 speed 100
 no cdp enable
 spanning-tree portfast
 spanning-tree bpduguard enable
 storm-control broadcast level 75
 shutdown
!
interface FastEthernet0/14
 switchport access vlan 11
 switchport mode access
 speed 100
 no cdp enable
 spanning-tree portfast
 spanning-tree bpduguard enable
 storm-control broadcast level 75
 shutdown
!
interface FastEthernet0/15
 switchport access vlan 11
 switchport mode access
 speed 100
 no cdp enable
 spanning-tree portfast
 spanning-tree bpduguard enable
 storm-control broadcast level 75
 shutdown
!
interface FastEthernet0/16
 switchport access vlan 11
 switchport mode access
 speed 100
 no cdp enable
 spanning-tree portfast
 spanning-tree bpduguard enable
 storm-control broadcast level 75
 shutdown
!
interface FastEthernet0/17
 switchport access vlan 11
 switchport mode access
 speed 100
 no cdp enable
 spanning-tree portfast
 spanning-tree bpduguard enable
 storm-control broadcast level 75
 shutdown
!
interface FastEthernet0/18
 switchport access vlan 11
 switchport mode access
 speed 100
 no cdp enable
 spanning-tree portfast
 spanning-tree bpduguard enable
 storm-control broadcast level 75
 shutdown
!
interface FastEthernet0/19
 switchport access vlan 11
 switchport mode access
 speed 100
 no cdp enable
 spanning-tree portfast
 spanning-tree bpduguard enable
 storm-control broadcast level 75
 shutdown
!
interface FastEthernet0/20
 switchport access vlan 11
 switchport mode access
 speed 100
 no cdp enable
 spanning-tree portfast
 spanning-tree bpduguard enable
 storm-control broadcast level 75
 shutdown
!
interface FastEthernet0/21
 switchport access vlan 11
 switchport mode access
 speed 100
 no cdp enable
 spanning-tree portfast
 spanning-tree bpduguard enable
 storm-control broadcast level 75
 shutdown
!
interface FastEthernet0/22
 switchport access vlan 11
 switchport mode access
 speed 100
 no cdp enable
 spanning-tree portfast
 spanning-tree bpduguard enable
 storm-control broadcast level 75
 shutdown
!
interface FastEthernet0/23
 switchport access vlan 11
 switchport mode access
 speed 100
 no cdp enable
 spanning-tree portfast
 spanning-tree bpduguard enable
 storm-control broadcast level 75
 shutdown
!
interface FastEthernet0/24
 switchport access vlan 11
 switchport mode access
 speed 100
 no cdp enable
 spanning-tree portfast
 spanning-tree bpduguard enable
 storm-control broadcast level 75
 shutdown
!
interface GigabitEthernet0/1
 switchport trunk native vlan 90
 switchport trunk allowed vlan 15,25,35,88,90
 switchport mode trunk
!
interface GigabitEthernet0/2
 switchport access vlan 11
 shutdown
!
interface Vlan1
 no ip address
 shutdown
!
interface Vlan88
 mac-address 00d0.9741.4601
 ip address 172.20.6.11 255.255.255.128
!
ip default-gateway 172.20.14.1
!
!
!
!
line con 0
!
line vty 0 4
 login
line vty 5 15
 login
!
!
!
!
end}

TOP
{CR1#show r

Building configuration...

Current configuration : 1095 bytes
!
version 15.1
no service timestamps log datetime msec
no service timestamps debug datetime msec
no service password-encryption
!
hostname CR1
!
!
!
!
!
!
!
!
no ip cef
no ipv6 cef
!
!
!
!
license udi pid CISCO2901/K9 sn FTX15245A6C-
!
!
!
!
!
!
!
!
!
!
!
spanning-tree mode pvst
!
!
!
!
!
!
interface Loopback0
 ip address 3.3.3.3 255.255.255.255
!
interface GigabitEthernet0/0
 no ip address
 duplex auto
 speed auto
 shutdown
!
interface GigabitEthernet0/1
 no ip address
 duplex auto
 speed auto
 shutdown
!
interface Serial0/0/0
 ip address 172.20.20.9 255.255.255.252
 clock rate 64000
!
interface Serial0/0/1
 ip address 172.20.20.5 255.255.255.252
!
interface Serial0/1/0
 no ip address
 clock rate 64000
 shutdown
!
interface Serial0/1/1
 no ip address
 clock rate 64000
 shutdown
!
interface Vlan1
 no ip address
 shutdown
!
router ospf 1
 router-id 33.33.33.33
 log-adjacency-changes
 network 172.20.20.4 0.0.0.3 area 0
 network 172.20.20.8 0.0.0.3 area 0
!
ip classless
!
ip flow-export version 9
!
!
!
no cdp run
!
!
!
!
!
!
line con 0
!
line aux 0
!
line vty 0 4
 login
!
!
!
end

}

我不确定如何处理 G/端口。我希望有人能帮助我或为我指明正确的方向。

我希望这个编辑有帮助。这是很多信息。

在此处输入图像描述

1个回答

您没有将 VLAN 通告给其他路由器,因为它们不是 OSPF 域的一部分。

OSPF 配置定义了哪些接口包含在 OSPF(域)中。您只包括了路由器之间的链接,因此这就是 OSPF 将通告的全部内容。

为此,请在 OSPF 部分中创建包含路由器子接口的网络语句。

例如,在 R1 上,您可以包括:

network 172.20.0.1 0.0.0.0 area 0

这将通告 VLAN 15。您可以为其他 VLAN(在两个路由器上)执行其余操作。