跨域VPN的解决方案主要是为了解决客户不同AS之间的站点的互通问题,即客户的VPN路由可以在两个AS之间进行传递。RFC4364介绍了三种解决方案,我会在接下来的文章中一一介绍。本文先说第一种解决方案:Option A,这种解决方案需要在两个AS之间的ASBR上使用专门的接口去传递路由信息,所以我们也称这种为VRF-to-VRF。
写在最前面
配置步骤如下:
- 配置IP地址以及VRF
- 配置两个AS中的IGP协议_ISIS
- 配置AS中的标签分配协议(LDP)
- 配置CE与PE,PE与ASBR之间的BGP邻居
- 配置ASRB之间路由互相引入
- 验证连通性
配置IP地址以及VRF
1
```
2
R1:
3
interface Loopback0
4
ipv4 address 10.1.1.1 255.255.255.255
5
interface GigabitEthernet0/0/0/0
6
ipv4 address 10.1.12.1 255.255.255.0
7
```
8
```
9
R2:
10
vrf VIP
11
address-family ipv4 unicast
12
import route-target
13
100:100
14
export route-target
15
100:100
16
17
interface Loopback0
18
ipv4 address 10.1.2.2 255.255.255.255
19
interface GigabitEthernet0/0/0/0
20
vrf VIP
21
ipv4 address 10.1.12.2 255.255.255.0
22
interface GigabitEthernet0/0/0/1
23
ipv4 address 10.1.23.2 255.255.255.0
24
```
25
```
26
R3:
27
interface Loopback0
28
ipv4 address 10.1.3.3 255.255.255.255
29
interface GigabitEthernet0/0/0/0
30
ipv4 address 10.1.34.3 255.255.255.0
31
interface GigabitEthernet0/0/0/1
32
ipv4 address 10.1.23.3 255.255.255.0
33
```
34
```
35
R4:
36
vrf VIP
37
address-family ipv4 unicast
38
import route-target
39
100:100
40
export route-target
41
100:100
42
43
interface Loopback0
44
ipv4 address 10.1.4.4 255.255.255.255
45
interface GigabitEthernet0/0/0/0
46
ipv4 address 10.1.34.4 255.255.255.0
47
interface GigabitEthernet0/0/0/1 <<<这个就是前文所说的ASBR上特殊的接口
48
vrf VIP
49
ipv4 address 10.1.45.4 255.255.255.0
50
```
51
```
52
R5:
53
vrf VIP
54
address-family ipv4 unicast
55
import route-target
56
100:100
57
export route-target
58
100:100
59
60
interface Loopback0
61
ipv4 address 10.1.5.5 255.255.255.255
62
interface GigabitEthernet0/0/0/0
63
ipv4 address 10.1.56.5 255.255.255.0
64
interface GigabitEthernet0/0/0/1
65
vrf VIP
66
ipv4 address 10.1.45.5 255.255.255.0
67
```
68
```
69
R6:
70
interface Loopback0
71
ipv4 address 10.1.6.6 255.255.255.255
72
interface GigabitEthernet0/0/0/0
73
ipv4 address 10.1.56.6 255.255.255.0
74
interface GigabitEthernet0/0/0/1
75
ipv4 address 10.1.67.6 255.255.255.0
76
```
77
```
78
R7:
79
vrf VIP
80
address-family ipv4 unicast
81
import route-target
82
100:100
83
export route-target
84
100:100
85
86
interface Loopback0
87
ipv4 address 10.1.7.7 255.255.255.255
88
interface GigabitEthernet0/0/0/0
89
vrf VIP
90
ipv4 address 10.1.78.7 255.255.255.0
91
interface GigabitEthernet0/0/0/1
92
ipv4 address 10.1.67.7 255.255.255.0
93
```
94
```
95
R8:
96
interface Loopback0
97
ipv4 address 10.1.8.8 255.255.255.255
98
interface GigabitEthernet0/0/0/0
99
ipv4 address 10.1.78.8 255.255.255.0
100
```
配置两个AS中的IGP协议_ISIS
1
```
2
R2:
3
router isis 1
4
is-type level-2-only
5
net 49.0000.0000.0000.0001.00
6
address-family ipv4 unicast
7
metric-style wide
8
!
9
interface Loopback0
10
passive
11
address-family ipv4 unicast
12
!
13
!
14
interface GigabitEthernet0/0/0/1
15
point-to-point
16
address-family ipv4 unicast
17
!
18
```
19
```
20
R3:
21
router isis 1
22
is-type level-2-only
23
net 49.0000.0000.0000.0002.00
24
address-family ipv4 unicast
25
metric-style wide
26
!
27
interface Loopback0
28
passive
29
address-family ipv4 unicast
30
!
31
!
32
interface GigabitEthernet0/0/0/0
33
point-to-point
34
address-family ipv4 unicast
35
!
36
!
37
interface GigabitEthernet0/0/0/1
38
point-to-point
39
address-family ipv4 unicast
40
!
41
!
42
!
43
```
44
```
45
R4:
46
router isis 1
47
is-type level-2-only
48
net 49.0000.0000.0000.0004.00
49
address-family ipv4 unicast
50
metric-style wide
51
!
52
interface Loopback0
53
passive
54
address-family ipv4 unicast
55
!
56
!
57
interface GigabitEthernet0/0/0/0
58
point-to-point
59
address-family ipv4 unicast
60
!
61
!
62
!
63
```
64
```
65
R5:
66
router isis 1
67
is-type level-2-only
68
net 49.0001.0000.0000.0005.00
69
address-family ipv4 unicast
70
metric-style wide
71
!
72
interface Loopback0
73
passive
74
address-family ipv4 unicast
75
!
76
!
77
interface GigabitEthernet0/0/0/0
78
point-to-point
79
address-family ipv4 unicast
80
!
81
!
82
!
83
```
84
```
85
R6:
86
router isis 1
87
is-type level-2-only
88
net 49.0001.0000.0000.0006.00
89
address-family ipv4 unicast
90
metric-style wide
91
!
92
interface Loopback0
93
passive
94
address-family ipv4 unicast
95
!
96
!
97
interface GigabitEthernet0/0/0/0
98
point-to-point
99
address-family ipv4 unicast
100
!
101
!
102
interface GigabitEthernet0/0/0/1
103
point-to-point
104
address-family ipv4 unicast
105
!
106
!
107
!
108
```
109
```
110
R7:
111
router isis 1
112
is-type level-2-only
113
net 49.0001.0000.0000.0007.00
114
address-family ipv4 unicast
115
metric-style wide
116
!
117
interface Loopback0
118
passive
119
address-family ipv4 unicast
120
!
121
!
122
interface GigabitEthernet0/0/0/1
123
point-to-point
124
address-family ipv4 unicast
125
!
126
!
127
!
128
```
配置AS中的标签分配协议(LDP)
1
```
2
R2:
3
mpls ldp
4
log
5
neighbor
6
!
7
router-id 10.1.2.2
8
address-family ipv4
9
label
10
local
11
allocate for host-routes
12
!
13
!
14
!
15
interface GigabitEthernet0/0/0/1
16
!
17
!
18
```
19
```
20
R3:
21
mpls ldp
22
log
23
neighbor
24
!
25
router-id 10.1.3.3
26
address-family ipv4
27
label
28
local
29
allocate for host-routes
30
!
31
!
32
!
33
interface GigabitEthernet0/0/0/0
34
!
35
interface GigabitEthernet0/0/0/1
36
!
37
!
38
```
39
```
40
R4:
41
mpls ldp
42
log
43
neighbor
44
!
45
router-id 10.1.4.4
46
address-family ipv4
47
label
48
local
49
allocate for host-routes
50
!
51
!
52
!
53
interface GigabitEthernet0/0/0/0
54
!
55
!
56
```
57
```
58
R5:
59
mpls ldp
60
log
61
neighbor
62
!
63
router-id 10.1.5.5
64
address-family ipv4
65
label
66
local
67
allocate for host-routes
68
!
69
!
70
!
71
interface GigabitEthernet0/0/0/0
72
!
73
!
74
```
75
```
76
R6:
77
mpls ldp
78
log
79
neighbor
80
!
81
router-id 10.1.6.6
82
address-family ipv4
83
label
84
local
85
allocate for host-routes
86
!
87
!
88
!
89
interface GigabitEthernet0/0/0/0
90
!
91
interface GigabitEthernet0/0/0/1
92
!
93
!
94
```
95
```
96
R7:
97
mpls ldp
98
log
99
neighbor
100
!
101
router-id 10.1.7.7
102
address-family ipv4
103
label
104
local
105
allocate for host-routes
106
!
107
!
108
!
109
interface GigabitEthernet0/0/0/1
110
!
111
!
112
```
配置CE与PE,PE与ASBR之间的BGP邻居
需要提前了解到的是,在IOS XR中, IBGP可以不用配置router-policy,但是对于EBGP,一定需要配置router-policy,入向和出向都需要配置,即使router-policy只有一个关键字pass.入向不配置,会drop对端发来的update;出向不配置,不会发布update
1
```
2
R1:
3
route-policy EBGP_PASS
4
pass
5
end-policy
6
!
7
router bgp 65000
8
bgp router-id 10.1.1.1
9
address-family ipv4 unicast
10
network 10.1.1.1/32
11
!
12
neighbor 10.1.12.2
13
remote-as 1
14
address-family ipv4 unicast
15
route-policy EBGP_PASS in
16
route-policy EBGP_PASS out
17
!
18
!
19
!
20
```
21
```
22
R2:
23
router bgp 1
24
bgp router-id 10.1.2.2
25
address-family vpnv4 unicast
26
!
27
neighbor 10.1.4.4
28
remote-as 1
29
update-source Loopback0
30
address-family vpnv4 unicast
31
next-hop-self
32
!
33
!
34
vrf VIP
35
rd auto
36
address-family ipv4 unicast
37
!
38
neighbor 10.1.12.1
39
remote-as 65000
40
address-family ipv4 unicast
41
route-policy EBGP_PASS in
42
route-policy EBGP_PASS out
43
!
44
!
45
!
46
!
47
```
48
```
49
R4
50
router bgp 1
51
bgp router-id 10.1.4.4
52
address-family vpnv4 unicast
53
!
54
neighbor 10.1.2.2
55
remote-as 1
56
update-source Loopback0
57
address-family vpnv4 unicast
58
next-hop-self
59
!
60
!
61
vrf VIP <<<配置VRF的原因是为了能让受到的VPNv4路由加入路由表,否则我们只会在BGP 路由表中看到
62
rd auto
63
address-family ipv4 unicast
64
!
65
!
66
!
67
```
68
```
69
R5:
70
router bgp 2
71
bgp router-id 10.1.5.5
72
address-family vpnv4 unicast
73
!
74
neighbor 10.1.7.7
75
remote-as 2
76
update-source Loopback0
77
address-family vpnv4 unicast
78
next-hop-self
79
!
80
!
81
vrf VIP
82
rd auto
83
address-family ipv4 unicast
84
!
85
!
86
!
87
```
88
```
89
R7:
90
router bgp 2
91
bgp router-id 10.1.7.7
92
address-family vpnv4 unicast
93
!
94
neighbor 10.1.5.5
95
remote-as 2
96
update-source Loopback0
97
address-family vpnv4 unicast
98
next-hop-self
99
!
100
!
101
vrf VIP
102
rd auto
103
address-family ipv4 unicast
104
!
105
neighbor 10.1.78.8
106
remote-as 65001
107
address-family ipv4 unicast
108
route-policy EBGP_PASS in
109
route-policy EBGP_PASS out
110
!
111
!
112
!
113
!
114
```
115
```
116
R8:
117
router bgp 65001
118
bgp router-id 10.1.8.8
119
address-family ipv4 unicast
120
network 10.1.8.8/32
121
!
122
neighbor 10.1.78.7
123
remote-as 2
124
address-family ipv4 unicast
125
route-policy EBGP_PASS in
126
route-policy EBGP_PASS out
127
!
128
!
129
!
130
```
配置ASRB之间路由互相引入
1
```
2
R4:
3
router ospf VIP
4
vrf VIP
5
capability vrf-lite
6
redistribute bgp 1
7
area 0
8
interface GigabitEthernet0/0/0/1
9
!
10
!
11
!
12
!
13
router bgp 1
14
vrf VIP
15
rd auto
16
address-family ipv4 unicast
17
redistribute ospf VIP
18
!
19
!
20
!
21
```
22
```
23
R5:
24
router ospf VIP
25
vrf VIP
26
capability vrf-lite
27
redistribute bgp 2
28
area 0
29
interface GigabitEthernet0/0/0/1
30
!
31
!
32
!
33
!
34
router bgp 2
35
vrf VIP
36
rd auto
37
address-family ipv4 unicast
38
redistribute ospf VIP
39
!
40
!
41
!
42
```
验证连通性
1
```
2
RP/0/0/CPU0:R1#traceroute 10.1.8.8 source 10.1.1.1
3
Mon Jun 24 01:24:28.393 UTC
4
5
Type escape sequence to abort.
6
Tracing the route to 10.1.8.8
7
8
1 10.1.12.2 0 msec 0 msec 0 msec
9
2 10.1.23.3 [MPLS: Labels 24001/24002 Exp 0] 9 msec 19 msec 9 msec
10
3 10.1.34.4 [MPLS: Label 24002 Exp 0] 19 msec 19 msec 9 msec
11
4 10.1.45.5 9 msec 9 msec 9 msec
12
5 10.1.56.6 [MPLS: Labels 24000/24002 Exp 0] 29 msec 19 msec 29 msec
13
6 10.1.67.7 [MPLS: Label 24002 Exp 0] 29 msec 19 msec 29 msec
14
7 10.1.78.8 29 msec * 19 msec
15
RP/0/0/CPU0:R1#
Q&A
为什么需要配置这个命令”capability vrf-lite”?
主要目的是为了能将收到的路由顺利加表,原理如下:R4对于R5而言是个PE设备,PE在决定将Type3, 5, 7的LSA发布给对端的CE时,都会置为一个DN bit,如下所示,对端CE收到DN bit的LSA是不会加表的,主要目的是为了防止环路。所以在这种情景下,使用这条命令可以不产生DN bit,使收到的路由能顺利的加表.
1
```
2
RP/0/0/CPU0:R4#show ospf vrf VIP database external
3
Sat Jun 22 13:53:37.752 UTC
4
5
6
OSPF Router with ID (10.1.4.4) (Process ID VIP, VRF VIP)
7
8
Type-5 AS External Link States
9
10
LS age: 28
11
Options: (No TOS-capability, DC, DN)
12
LS Type: AS External Link
13
Link State ID: 10.1.1.1 (External Network Number)
14
Advertising Router: 10.1.4.4
15
LS Seq Number: 80000004
16
Checksum: 0xaf8e
17
Length: 36
18
Network Mask: /32
19
Metric Type: 2 (Larger than any link state path)
20
TOS: 0
21
Metric: 1
22
Forward Address: 0.0.0.0
23
External Route Tag: 3489660929
24
```
配置文件:
https://mega.nz/#F!xKg1VSJQ!MOGudG5349kecCxBY52LRA
This Blog from Xuxing's Blog;
Link: http://imxing.cn/?p=147
No comments:
Post a Comment