- 积分
- 488
- 鸿鹄币
- 个
- 好评度
- 点
- 精华
- 最后登录
- 1970-1-1
- 阅读权限
- 30
- 听众
- 收听
初级工程师
  
|
3鸿鹄币
拓扑如下:
中间为R2 R3 R4 模拟isp网络。协议包括mpls ospf bgp
R6 R7 模拟CE端。
具体配置如下:
R6:
router ospf 10
log-adjacency-changes
network 6.6.6.6 0.0.0.0 area 0
network 26.1.1.6 0.0.0.0 area 0
interface Serial1/0
ip address 26.1.1.6 255.255.255.0
serial restart-delay 0
interface Loopback0
ip address 6.6.6.6 255.255.255.0
R2 :
ip vrf gongsia
rd 1:1
route-target export 1:1
route-target import 1:1
mpls label range 200 299
interface Loopback0
ip address 2.2.2.2 255.255.255.0
interface Serial1/0
ip vrf forwarding gongsia
ip address 26.1.1.2 255.255.255.0
serial restart-delay 0
interface Serial1/2
ip address 23.1.1.2 255.255.255.0
mpls ip
serial restart-delay 0
router ospf 10 vrf gongsia
log-adjacency-changes
redistribute bgp 2 subnets
network 26.1.1.2 0.0.0.0 area 0
!
router ospf 1
router-id 2.2.2.2
log-adjacency-changes
network 2.2.2.2 0.0.0.0 area 0
network 23.1.1.2 0.0.0.0 area 0
!
router bgp 2
bgp router-id 2.2.2.2
no bgp default ipv4-unicast
bgp log-neighbor-changes
neighbor 4.4.4.4 remote-as 4
neighbor 4.4.4.4 ebgp-multihop 255
neighbor 4.4.4.4 update-source Loopback0
!
address-family vpnv4
neighbor 4.4.4.4 activate
neighbor 4.4.4.4 send-community extended
exit-address-family
!
address-family ipv4 vrf gongsia
redistribute ospf 10 vrf gongsia
no synchronization
exit-address-family
R3:
router ospf 1
router-id 3.3.3.3
log-adjacency-changes
network 3.3.3.3 0.0.0.0 area 0
network 23.1.1.3 0.0.0.0 area 0
network 34.1.1.3 0.0.0.0 area 0
interface Serial1/0
ip address 23.1.1.3 255.255.255.0
mpls ip
serial restart-delay 0
!
interface Serial1/1
ip address 34.1.1.3 255.255.255.0
mpls ip
serial restart-delay 0
interface Loopback0
ip address 3.3.3.3 255.255.255.0
R4:
ip vrf gongsia
rd 1:1
route-target export 1:1
route-target import 1:1
!
no ip domain lookup
!
mpls label range 400 499
interface Loopback0
ip address 4.4.4.4 255.255.255.0
interface Serial1/0
ip address 34.1.1.4 255.255.255.0
mpls ip
serial restart-delay 0
interface Serial1/2
ip vrf forwarding gongsia
ip address 47.1.1.4 255.255.255.0
serial restart-delay 0
router ospf 10 vrf gongsia
router-id 47.1.1.4
log-adjacency-changes
redistribute bgp 4 subnets
network 47.1.1.4 0.0.0.0 area 0
!
router ospf 1
log-adjacency-changes
network 4.4.4.4 0.0.0.0 area 0
network 34.1.1.4 0.0.0.0 area 0
!
router bgp 4
bgp router-id 4.4.4.4
no bgp default ipv4-unicast
bgp log-neighbor-changes
neighbor 2.2.2.2 remote-as 2
neighbor 2.2.2.2 ebgp-multihop 255
neighbor 2.2.2.2 update-source Loopback0
!
address-family vpnv4
neighbor 2.2.2.2 activate
neighbor 2.2.2.2 send-community extended
exit-address-family
!
address-family ipv4 vrf gongsia
redistribute ospf 10 vrf gongsia
no synchronization
exit-address-family
R7 :
interface Loopback0
ip address 7.7.7.7 255.255.255.0
interface Serial1/0
ip address 47.1.1.7 255.255.255.0
serial restart-delay 0
router ospf 10
router-id 7.7.7.7
log-adjacency-changes
network 7.7.7.7 0.0.0.0 area 0
network 47.1.1.7 0.0.0.0 area 0
下面是一些sh命令看到的结果:
R6#sh ip route os
7.0.0.0/32 is subnetted, 1 subnets
O IA 7.7.7.7 [110/129] via 26.1.1.2, 02:54:49, Serial1/0
47.0.0.0/24 is subnetted, 1 subnets
O IA 47.1.1.0 [110/65] via 26.1.1.2, 02:54:49, Serial1/0
R2#sh mpls forwarding-table
Local Outgoing Prefix Bytes tag Outgoing Next Hop
tag tag or VC or Tunnel Id switched interface
200 Pop tag 34.1.1.0/24 0 Se1/2 point2point
201 Untagged 3.3.3.3/32 0 Se1/2 point2point
202 301 4.4.4.4/32 0 Se1/2 point2point
203 Untagged 6.6.6.6/32[V] 0 Se1/0 point2point
204 Aggregate 26.1.1.0/24[V] 0
R2#sh ip b vpnv4 all
BGP table version is 19, local router ID is 2.2.2.2
Status codes: s suppressed, d damped, h history, * valid, > best, i - internal,
r RIB-failure, S Stale
Origin codes: i - IGP, e - EGP, ? - incomplete
Network Next Hop Metric LocPrf Weight Path
Route Distinguisher: 1:1 (default for vrf gongsia)
*> 6.6.6.6/32 26.1.1.6 65 32768 ?
*> 7.7.7.7/32 4.4.4.4 65 0 4 ?
*> 26.1.1.0/24 0.0.0.0 0 32768 ?
*> 47.1.1.0/24 4.4.4.4 0 0 4 ?
R2#sh ip rou vrf gongsia
Routing Table: gongsia
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
6.0.0.0/32 is subnetted, 1 subnets
O 6.6.6.6 [110/65] via 26.1.1.6, 02:58:05, Serial1/0
7.0.0.0/32 is subnetted, 1 subnets
B 7.7.7.7 [20/65] via 4.4.4.4, 02:55:43
26.0.0.0/24 is subnetted, 1 subnets
C 26.1.1.0 is directly connected, Serial1/0
47.0.0.0/24 is subnetted, 1 subnets
B 47.1.1.0 [20/0] via 4.4.4.4, 02:55:43
R3#sh mpls forwarding-table
Local Outgoing Prefix Bytes tag Outgoing Next Hop
tag tag or VC or Tunnel Id switched interface
300 Untagged 2.2.2.2/32 28467 Se1/0 point2point
301 Untagged 4.4.4.4/32 26437 Se1/1 point2point
R4#sh ip rou vrf gongsia
Routing Table: gongsia
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
6.0.0.0/32 is subnetted, 1 subnets
B 6.6.6.6 [20/65] via 2.2.2.2, 02:10:13
7.0.0.0/32 is subnetted, 1 subnets
O 7.7.7.7 [110/65] via 47.1.1.7, 04:57:46, Serial1/2
26.0.0.0/24 is subnetted, 1 subnets
B 26.1.1.0 [20/0] via 2.2.2.2, 02:10:13
47.0.0.0/24 is subnetted, 1 subnets
C 47.1.1.0 is directly connected, Serial1/2
R4#sh mpls forwarding-table
Local Outgoing Prefix Bytes tag Outgoing Next Hop
tag tag or VC or Tunnel Id switched interface
400 300 2.2.2.2/32 0 Se1/0 point2point
401 Untagged 3.3.3.3/32 0 Se1/0 point2point
402 Pop tag 23.1.1.0/24 0 Se1/0 point2point
403 Untagged 7.7.7.7/32[V] 0 Se1/2 point2point
404 Aggregate 47.1.1.0/24[V] 0
R7#sh ip rou os
6.0.0.0/32 is subnetted, 1 subnets
O IA 6.6.6.6 [110/129] via 47.1.1.4, 02:10:46, Serial1/0
26.0.0.0/24 is subnetted, 1 subnets
O IA 26.1.1.0 [110/65] via 47.1.1.4, 02:10:45, Serial1/0
R7#ping 6.6.6.6 source 7.7.7.7
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 6.6.6.6, timeout is 2 seconds:
Packet sent with a source address of 7.7.7.7
.....
Success rate is 0 percent (0/5)
R4#ping vrf gongsia 6.6.6.6
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 6.6.6.6, timeout is 2 seconds:
.....
Success rate is 0 percent (0/5)
R4#sh ip rou vrf gongsia
Routing Table: gongsia
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
6.0.0.0/32 is subnetted, 1 subnets
B 6.6.6.6 [20/65] via 2.2.2.2, 02:12:21
7.0.0.0/32 is subnetted, 1 subnets
O 7.7.7.7 [110/65] via 47.1.1.7, 04:59:53, Serial1/2
26.0.0.0/24 is subnetted, 1 subnets
B 26.1.1.0 [20/0] via 2.2.2.2, 02:12:21
47.0.0.0/24 is subnetted, 1 subnets
C 47.1.1.0 is directly connected, Serial1/2
这边可以看到去往6.6.6.6的下一条是2.2.2.2 但是在vrf理由表里面没有去往2.2.2.2 的。我猜想问题处在这里。但是不知道怎么解决,求大神告知啊。。
|
最佳答案
查看完整内容
OSPF默认环回口是32位路由,
而MPLS分发的标签是24位的路由标签
所以,标签包无法转发
解决办法:1、改成点到点,2、32位环回口
|