无法ping回环接口gns3

网络工程 网络 联网 gns3
2022-02-14 03:27:26

我有以下 gns3 拓扑

在此处输入图像描述

我无法 ping R1 环回接口(无法访问目标主机)我不确定出了什么问题

R1配置如下图

hostname R1
!
boot-start-marker
boot-end-marker
!
aqm-register-fnf
!
!
aaa new-model
!
!
aaa authentication login default local
aaa authentication login SSH-LOGIN local
!
!
!
!
!
aaa session-id common
no ip icmp rate-limit unreachable
!
!
!
!
ip dhcp pool POOL-102
 network 202.78.102.0 255.255.255.0
 default-router 202.78.2.1
!
!
!
no ip domain lookup
ip domain name wic2001.com
ip cef
ipv6 unicast-routing
ipv6 cef
!
multilink bundle-name authenticated
!
!
!
!
!
!
!
!
!
username ---- secret 5 $1$D/vk$a8XNtzs/Cir2tVb/H7Lxv0
!
redundancy
!
!
ip tcp synwait-time 5
!
!
!
!
!
!
!
!
!
!
interface Loopback0
 ip address 202.78.10.10 255.255.255.255
 ipv6 address 2001:202:78:10::10/128
!
interface Port-channel1
 ip address 100.100.23.1 255.255.255.252
 ipv6 address 2001:100:100::1/64
 hold-queue 150 in
!
interface FastEthernet0/0
 no ip address
 shutdown
 duplex half
!
interface GigabitEthernet1/0
 ip address 202.78.1.1 255.255.255.0
 ip ospf authentication message-digest
 ip ospf message-digest-key 1 md5 hako
 negotiation auto
 ipv6 address 2001:202:78:1::1/64
 ipv6 ospf 1 area 0
!
interface GigabitEthernet2/0
 ip address 202.78.2.1 255.255.255.0
 ip ospf authentication message-digest
 ip ospf message-digest-key 1 md5 hako
 negotiation auto
 ipv6 address 2001:202:78:2::1/64
 ipv6 ospf 1 area 0
!
interface GigabitEthernet3/0
 no ip address
 negotiation auto
 channel-group 1
!
interface GigabitEthernet4/0
 no ip address
 negotiation auto
 channel-group 1
!
interface GigabitEthernet5/0
 ip address 202.78.5.1 255.255.255.0
 negotiation auto
 ipv6 address 2001:202:78:5::1/64
 ipv6 ospf 1 area 10
!
interface GigabitEthernet6/0
 no ip address
 shutdown
 negotiation auto
!
router ospf 1
 router-id 1.1.1.1
 network 202.78.1.0 0.0.0.255 area 0
 network 202.78.2.0 0.0.0.255 area 0
 network 202.78.5.0 0.0.0.255 area 10
 default-information originate
!
router bgp 178
 bgp log-neighbor-changes
 neighbor 2001:100:100::2 remote-as 299
 neighbor 100.100.23.2 remote-as 299
 !
 address-family ipv4
  network 202.78.1.0
  network 202.78.2.0
  network 202.78.5.0
  network 202.78.101.0
  network 202.78.102.0
  network 202.78.103.0
  no neighbor 2001:100:100::2 activate
  neighbor 100.100.23.2 activate
 exit-address-family
 !
 address-family ipv6
  network 2001:202:78:1::/64
  network 2001:202:78:2::/64
  network 2001:202:78:5::/64
  network 2001:202:78:101::/64
  network 2001:202:78:102::/64
  network 2001:202:78:103::/64
  neighbor 2001:100:100::2 activate
 exit-address-family
!
ip forward-protocol nd
no ip http server
no ip http secure-server
!
!
!
no cdp log mismatch duplex
ipv6 router ospf 1
 router-id 1.1.1.1
!
!
!
!
!
!
control-plane
!
!
mgcp behavior rsip-range tgcp-only
mgcp behavior comedia-role none
mgcp behavior comedia-check-media-src disable
mgcp behavior comedia-sdp-force disable
!
mgcp profile default
!
!
!
gatekeeper
 shutdown
!
!
line con 0
 exec-timeout 0 0
 privilege level 15
 logging synchronous
 stopbits 1
line aux 0
 exec-timeout 0 0
 privilege level 15
 logging synchronous
 stopbits 1
line vty 0 4
 login authentication SSH-LOGIN
 transport input ssh
!
!
end

R3:

hostname R3
!
boot-start-marker
boot-end-marker
!
!
!
no aaa new-model
no ip icmp rate-limit unreachable
!
!
!
!
!
!
no ip domain lookup
ip cef
ipv6 unicast-routing
ipv6 cef
!
multilink bundle-name authenticated
!
!
!
!
!
!
!
!
!
!
redundancy
!
!
ip tcp synwait-time 5
!
!
!
!
!
!
!
!
!
!
interface FastEthernet0/0
 no ip address
 shutdown
 duplex half
!
interface GigabitEthernet1/0
 ip address 202.78.104.1 255.255.255.0
 negotiation auto
 ipv6 address 2001:202:78:104::1/64
 ipv6 ospf 1 area 10
!
interface GigabitEthernet2/0
 ip address 192.168.50.1 255.255.255.0
 ip nat inside
 ip virtual-reassembly in
 negotiation auto
!
interface GigabitEthernet3/0
 no ip address
 shutdown
 negotiation auto
!
interface GigabitEthernet4/0
 no ip address
 shutdown
 negotiation auto
!
interface GigabitEthernet5/0
 ip address 202.78.5.2 255.255.255.0
 ip nat outside
 ip virtual-reassembly in
 negotiation auto
 ipv6 address 2001:202:78:5::2/64
 ipv6 ospf 1 area 10
!
interface GigabitEthernet6/0
 no ip address
 shutdown
 negotiation auto
!
router ospf 1
 router-id 4.4.4.4
 network 202.78.5.0 0.0.0.255 area 10
 network 202.78.104.0 0.0.0.255 area 10
!
ip forward-protocol nd
no ip http server
no ip http secure-server
!
!
ip nat inside source list 1 interface GigabitEthernet5/0 overload
!
no cdp log mismatch duplex
ipv6 router ospf 1
 router-id 4.4.4.4
!
!
!
access-list 1 permit 192.168.50.0 0.0.0.31
!
control-plane
!
!
mgcp behavior rsip-range tgcp-only
mgcp behavior comedia-role none
mgcp behavior comedia-check-media-src disable
mgcp behavior comedia-sdp-force disable
!
mgcp profile default
!
!
!
gatekeeper
 shutdown
!
!
line con 0
 exec-timeout 0 0
 privilege level 15
 logging synchronous
 stopbits 1
line aux 0
 exec-timeout 0 0
 privilege level 15
 logging synchronous
 stopbits 1
line vty 0 4
 login
 transport input all
!
!
end
2个回答

R1 的环回接口不在 OSPF 域中。下面的网络语句router ospf不包括环回接口。

我看到你也有这个default-information originate声明。这也在您的路由表中已有默认路由时才有效。如果将语句更改为default-information originate always,路由器将始终通告默认路由。

您的 R1 Loopback0 接口具有以下地址:

ip address 202.78.10.10 255.255.255.255

但您没有在 R1 OSPF 中宣传该地址:

router ospf 1
 router-id 1.1.1.1
 network 202.78.1.0 0.0.0.255 area 0
 network 202.78.2.0 0.0.0.255 area 0
 network 202.78.5.0 0.0.0.255 area 10
 default-information originate
!

这意味着 R3 不知道如何到达 R1 Loopbak0 地址,因此它会丢弃发往该地址的数据包。

您可以将 R1 环回地址添加到 R1 OSPF:

router ospf 1
 router-id 1.1.1.1
 network 202.78.1.0 0.0.0.255 area 0
 network 202.78.2.0 0.0.0.255 area 0
 network 202.78.5.0 0.0.0.255 area 10
 network 202.78.10.10 0.0.0.0 area 0   ! add this line
 default-information originate
!

您可以将 R3 上的静态路由添加到 R1 Loopback0:

ip route 202.78.10.10 255.255.255.255 GigabitEthernet5/0 202.78.5.1

您可以将默认路由添加到 R1 路由表:

ip route 0.0.0.0 0.0.0.0 Loopback0 202.78.10.10

您可以确保 R1 始终通告默认路由:

router ospf 1
 router-id 1.1.1.1
 network 202.78.1.0 0.0.0.255 area 0
 network 202.78.2.0 0.0.0.255 area 0
 network 202.78.5.0 0.0.0.255 area 10
 default-information originate always   ! add the always keyword
!

如果没有该always关键字,R1 只会在其路由表中已有默认路由时才发布默认路由,但添加该关键字意味着 R1 将发布默认路由,即使其路由表中没有默认路由。