在正式投入生产之前,我正在实验室中进行一些BGP测试(因此,此处使用的任何IP地址或AS编号等都是完全虚构的方式)。
一直困扰我的是Cisco IOS的输出show ip route
。这些路线按什么顺序排列,不是数字,1、2、58、10!它们未按协议或度量标准分组。
br2#show 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, 4 subnets
B 1.1.1.1 [200/0] via 10.10.0.1, 00:20:24
B 1.1.0.1 [200/0] via 10.10.0.1, 00:20:24
B 1.1.0.2 [20/0] via 10.20.0.1, 00:15:03
B 1.1.2.1 [200/0] via 10.10.0.1, 00:20:24
2.0.0.0/32 is subnetted, 4 subnets
B 2.1.2.1 [20/0] via 10.100.0.1, 07:41:53
B 2.1.3.1 [20/0] via 10.200.0.1, 07:41:53
B 2.1.1.1 [20/0] via 10.100.0.1, 07:41:53
B 2.1.4.1 [20/0] via 10.200.0.1, 07:41:53
58.0.0.0/8 is variably subnetted, 3 subnets, 2 masks
B 58.58.58.2/32 [200/0] via 10.65.12.2, 00:20:25
S 58.58.58.0/24 is directly connected, Null0
B 58.58.58.1/32 [200/0] via 10.65.11.2, 00:20:26
10.0.0.0/8 is variably subnetted, 15 subnets, 3 masks
i L2 10.10.0.0/30 [115/10] via 10.65.0.1, FastEthernet0/0
C 10.0.0.2/32 is directly connected, Loopback0
i L2 10.0.1.2/32 [115/30] via 10.65.0.1, FastEthernet0/0
i L2 10.0.0.1/32 [115/20] via 10.65.0.1, FastEthernet0/0
C 10.20.0.0/30 is directly connected, FastEthernet1/0
i L2 10.65.11.0/30 [115/20] via 10.65.0.1, FastEthernet0/0
i L2 10.65.13.0/30 [115/20] via 10.65.0.1, FastEthernet0/0
i L2 10.65.12.0/30 [115/20] via 10.65.0.1, FastEthernet0/0
i L2 10.65.1.0/28 [115/20] via 10.65.0.1, FastEthernet0/0
B 10.65.12.12/32 [200/0] via 10.65.12.2, 00:20:26
B 10.65.11.11/32 [200/0] via 10.65.11.2, 00:20:26
C 10.65.0.0/28 is directly connected, FastEthernet0/0
C 10.100.0.0/30 is directly connected, FastEthernet2/0.100
C 10.200.0.0/30 is directly connected, FastEthernet2/0.200
B 10.10.200.0/30 [20/0] via 10.200.0.1, 07:41:57
60.0.0.0/32 is subnetted, 1 subnets
B 60.0.0.60 [200/0] via 10.65.13.2, 00:20:27
例如,即使在前缀组的全类边界或整数边界之内,也会10.65.0.0/28
出现10.65.11.11/32
。
show ip cef
以数字顺序显示转发条目