首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
MCP广场
社区首页 >问答首页 >Ping Vrf回环接口

Ping Vrf回环接口
EN

Network Engineering用户
提问于 2017-09-30 16:27:26
回答 2查看 10.6K关注 0票数 1

我在做一个实验室,这很简单。就像我需要确认一些命令,但我真的很生气。

这是我的实验室。我配置了一个vrf和一个回环接口,并在vrf下应用它。环已从全局表中消失,并插入到vrf表中。因此,我添加了一个静态路由,以便能够从全局表中平移接口。现在,我可以看到全局表中插入的环回接口是静态的,但是我不能点击。

我觉得这里缺少一些愚蠢的东西,因为一切看起来都很好,而且应该能工作。我的路由器配置的输出如下:

代码语言:javascript
运行
复制
ip vrf HQ
 rd 30:50

!
!
!
!
!
!
!

interface Loopback1
 ip vrf forwarding HQ
 ip address 1.1.1.1 255.255.255.255
!

ip classless
ip route 1.1.1.1 255.255.255.255 Loopback1
no ip http server
no ip http secure-server
!
!
!
!


R2#sh ip ro
R2#sh ip route
Codes: C - connected, S - static, R - RIP, M - mobile, B - BGP
       D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
       N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
       E1 - OSPF external type 1, E2 - OSPF external type 2
       i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2
       ia - IS-IS inter area, * - candidate default, U - per-user static route
       o - ODR, P - periodic downloaded static route

Gateway of last resort is not set

     1.0.0.0/32 is subnetted, 1 subnets
S       1.1.1.1 is directly connected, Loopback1



R2#sh ip ro
R2#sh ip route vrf HQ

Routing Table: HQ
Codes: C - connected, S - static, R - RIP, M - mobile, B - BGP
       D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
       N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
       E1 - OSPF external type 1, E2 - OSPF external type 2
       i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2
       ia - IS-IS inter area, * - candidate default, U - per-user static route
       o - ODR, P - periodic downloaded static route

Gateway of last resort is not set

     1.0.0.0/32 is subnetted, 1 subnets
C       1.1.1.1 is directly connected, Loopback1
R2#

注意:我可以跟踪接口的ip。

EN

回答 2

Network Engineering用户

回答已采纳

发布于 2017-10-02 12:00:58

您需要的是从VRF到全局路由表的路由泄漏(您已经做到了),以及从全局路由表到VRF的路由泄漏。

我假设您的网络图非常简单,如下所示

在R2上,您已经拥有了ip route 1.1.1.1 255.255.255.255 Loopback1

现在需要另一个静态VRF路由将路由10.0.0.0/24泄漏到VRF总部:

代码语言:javascript
运行
复制
  ip route vrf HQ 10.0.0.0 255.255.255.0 10.0.0.1 global

在R2上的验证:

代码语言:javascript
运行
复制
R2#show run | i route
ip route 1.1.1.1 255.255.255.255 Loopback1
ip route vrf HQ 10.0.0.0 255.255.255.0 10.0.0.1 global


R2#show ip route | beg Gateway
Gateway of last resort is not set

     1.0.0.0/32 is subnetted, 1 subnets
S       1.1.1.1 is directly connected, Loopback1
     10.0.0.0/24 is subnetted, 1 subnets
C       10.0.0.0 is directly connected, FastEthernet0/0


R2#show ip route vrf HQ | beg Gateway
Gateway of last resort is not set

     1.0.0.0/32 is subnetted, 1 subnets
C       1.1.1.1 is directly connected, Loopback1
     10.0.0.0/24 is subnetted, 1 subnets
S       10.0.0.0 [1/0] via 10.0.0.1


R2#ping 1.1.1.1 source 10.0.0.2

Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 1.1.1.1, timeout is 2 seconds:
Packet sent with a source address of 10.0.0.2
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 68/70/72 ms

在R1上的验证:

代码语言:javascript
运行
复制
R1#show run | i route
ip route 1.1.1.1 255.255.255.255 10.0.0.2


R1#ping 1.1.1.1

Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 1.1.1.1, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 20/36/64 ms

我希望这是有帮助的,并回答你的问题。

票数 1
EN

Network Engineering用户

发布于 2017-09-30 18:27:53

您不需要静态路由,只需在vrf中按以下方式进行ping:

代码语言:javascript
运行
复制
ping vrf vrfname ip
票数 1
EN
页面原文内容由Network Engineering提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://networkengineering.stackexchange.com/questions/44610

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档