1.PE1 和 P 和 PE2 之间跑 IGP 协议
运营商里面首选的还是 ISIS 协议
我们实验的话, 用的是 OSPF 协议
R3 的 IP 地址和 OSPF 配置
- [R3]display ip int brief
- *down: administratively down
- ^down: standby
- (l): loopback
- (s): spoofing
- The number of interface that is UP in Physical is 5
- The number of interface that is DOWN in Physical is 1
- The number of interface that is UP in Protocol is 5
- The number of interface that is DOWN in Protocol is 1
- Interface IP Address/Mask Physical Protocol
- GigabitEthernet0/0/0 13.1.1.3/24 up up
- GigabitEthernet0/0/1 23.1.1.3/24 up up
- GigabitEthernet1/0/0 34.1.1.3/24 up up
- GigabitEthernet2/0/0 unassigned down down
- LoopBack0 3.3.3.3/32 up up(s)
- NULL0 unassigned up up(s)
- [R3]dis current-configuration configuration ospf
- [V200R003C00]
- #
- ospf 1 router-id 3.3.3.3
- area 0.0.0.0
- network 3.3.3.3 0.0.0.0
- network 34.1.1.0 0.0.0.255
- #
- return
- [R3]
R4 的 IP 地址和 OSPF 配置
- [R4]display ip int brief
- *down: administratively down
- ^down: standby
- (l): loopback
- (s): spoofing
- The number of interface that is UP in Physical is 4
- The number of interface that is DOWN in Physical is 0
- The number of interface that is UP in Protocol is 4
- The number of interface that is DOWN in Protocol is 0
- Interface IP Address/Mask Physical Protocol
- GigabitEthernet0/0/0 34.1.1.4/24 up up
- GigabitEthernet0/0/1 45.1.1.4/24 up up
- LoopBack0 4.4.4.4/32 up up(s)
- NULL0 unassigned up up(s)
- [R4]display current-configuration configuration ospf
- [V200R003C00]
- #
- ospf 1 router-id 4.4.4.4
- area 0.0.0.0
- network 4.4.4.4 0.0.0.0
- network 34.1.1.0 0.0.0.255
- network 45.1.1.0 0.0.0.255
- #
- return
R5 的 IP 地址和 OSPF 的配置
- <R5>display ip int brief
- *down: administratively down
- ^down: standby
- (l): loopback
- (s): spoofing
- The number of interface that is UP in Physical is 5
- The number of interface that is DOWN in Physical is 0
- The number of interface that is UP in Protocol is 5
- The number of interface that is DOWN in Protocol is 0
- Interface IP Address/Mask Physical Protocol
- GigabitEthernet0/0/0 45.1.1.5/24 up up
- GigabitEthernet0/0/1 56.1.1.5/24 up up
- GigabitEthernet1/0/0 57.1.1.5/24 up up
- LoopBack0 5.5.5.5/32 up up(s)
- NULL0 unassigned up up(s)
- <R5>display current-configuration configuration ospf
- [V200R003C00]
- #
- ospf 1 router-id 5.5.5.5
- area 0.0.0.0
- network 5.5.5.5 0.0.0.0
- network 45.1.1.0 0.0.0.255
- #
- return
2. 检查结果
在 R4 上面检查我们的结果
- [R4]display ospf peer brief
- OSPF Process 1 with Router ID 4.4.4.4
- Peer Statistic Information
- ----------------------------------------------------------------------------
- Area Id Interface Neighbor id State
- 0.0.0.0 GigabitEthernet0/0/0 3.3.3.3 Full
- 0.0.0.0 GigabitEthernet0/0/1 5.5.5.5 Full
- ----------------------------------------------------------------------------
在 R4 上面检查是否通过 OSPF 学习到 R3 和 R5network 发布的路由
- [R4]display ip routing-table protocol ospf
- Route Flags: R - relay, D - download to fib
- ------------------------------------------------------------------------------
- Public routing table : OSPF
- Destinations : 2 Routes : 2
- OSPF routing table status : <Active>
- Destinations : 2 Routes : 2
- Destination/Mask Proto Pre Cost Flags NextHop Interface
- 3.3.3.3/32 OSPF 10 1 D 34.1.1.3 GigabitEthernet0/0/0
- 5.5.5.5/32 OSPF 10 1 D 45.1.1.5 GigabitEthernet0/0/1
- OSPF routing table status : <Inactive>
- Destinations : 0 Routes : 0
3.PE1 和 P 和 PE2 之间跑 MPLS 协议和 MPLS LDP 协议
原因就是解决 BGP 跨设备路由黑洞问题
R3 的 MPLS 和 MPLS LDP 的配置
全局下的配置
- #
- mpls lsr-id 3.3.3.3
- mpls
- mpls ldp
- #
接口下的配置
- #
- interface GigabitEthernet1/0/0
- mpls
- mpls ldp
- #
R4 的 MPLS 和 MPLS LDP 的配置
全局下的配置
- #
- mpls lsr-id 4.4.4.4
- mpls
- mpls ldp
- #
接口下的配置
- #
- interface GigabitEthernet0/0/0
- mpls
- mpls ldp
- #
- interface GigabitEthernet0/0/1
- mpls
- mpls ldp
- #
R5 的 MPLS 和 MPLS LDP 的配置
全局下的配置
- #
- mpls lsr-id 5.5.5.5
- mpls
- mpls ldp
- #
接口下的配置
- #
- interface GigabitEthernet0/0/0
- mpls
- mpls ldp
- #
4. 检查 MPLS LDP 关系
在 R4 上面查看于 R3 和 R5 之间的 LDP 关系
- [R4]display mpls ldp session all
- LDP Session(s) in Public Network
- Codes: LAM(Label Advertisement Mode), SsnAge Unit(DDDD:HH:MM)
- A '*' before a session means the session is being deleted.
- ------------------------------------------------------------------------------
- PeerID Status LAM SsnRole SsnAge KASent/Rcv
- ------------------------------------------------------------------------------
- 3.3.3.3:0 Operational DU Active 0000:00:36 148/148
- 5.5.5.5:0 Operational DU Passive 0000:00:36 147/147
- ------------------------------------------------------------------------------
- TOTAL: 2 session(s) Found.
在 R5 上面分别查看是否对 3.3.3.3/32 分发标签
- <R5>display mpls lsp include 3.3.3.3 32
- -------------------------------------------------------------------------------
- LSP Information: LDP LSP
- -------------------------------------------------------------------------------
- FEC In/Out Label In/Out IF Vrf Name
- 3.3.3.3/32 NULL/1024 -/GE0/0/0
- 3.3.3.3/32 1024/1024 -/GE0/0/0
- <R4>display mpls lsp include 3.3.3.3 32
- -------------------------------------------------------------------------------
- LSP Information: LDP LSP
- -------------------------------------------------------------------------------
- FEC In/Out Label In/Out IF Vrf Name
- 3.3.3.3/32 NULL/3 -/GE0/0/0
- 3.3.3.3/32 1024/3 -/GE0/0/0
- <R3>display mpls lsp include 3.3.3.3 32
- -------------------------------------------------------------------------------
- LSP Information: LDP LSP
- -------------------------------------------------------------------------------
- FEC In/Out Label In/Out IF Vrf Name
- 3.3.3.3/32 3/NULL -/-
在 R3 上面分别查看是否对 5.5.5.5/32 分发标签
- <R3>display mpls lsp include 5.5.5.5 32
- -------------------------------------------------------------------------------
- LSP Information: LDP LSP
- -------------------------------------------------------------------------------
- FEC In/Out Label In/Out IF Vrf Name
- 5.5.5.5/32 NULL/1025 -/GE1/0/0
- 5.5.5.5/32 1025/1025 -/GE1/0/0
- <R4>display mpls lsp include 5.5.5.5 32
- -------------------------------------------------------------------------------
- LSP Information: LDP LSP
- -------------------------------------------------------------------------------
- FEC In/Out Label In/Out IF Vrf Name
- 5.5.5.5/32 NULL/3 -/GE0/0/1
- 5.5.5.5/32 1025/3 -/GE0/0/1
- <R5>display mpls lsp include 5.5.5.5 32
- -------------------------------------------------------------------------------
- LSP Information: LDP LSP
- -------------------------------------------------------------------------------
- FEC In/Out Label In/Out IF Vrf Name
- 5.5.5.5/32 3/NULL -/-
5. 在 PE1 和 PE2 上面分别配置 VRF 和 RD 和 RT
在 PE1 和 PE2 上面分别对 A 公司的分部和总部进行定义 VRF
PE1 上面定义 A 公司分部
- #
- ip ***-instance ***13
- ipv4-family
- route-distinguisher 1:3
- ***-target 100:300 export-extcommunity
- ***-target 100:300 import-extcommunity
- #
PE2 上面定义 A 公司总部
- #
- ip ***-instance ***75
- ipv4-family
- route-distinguisher 7:5
- ***-target 100:300 export-extcommunity
- ***-target 100:300 import-extcommunity
- #
在 PE1 和 PE2 上面分别对 A 公司的分部和总部进行定义 VRF 调用
PE1 上面定义 A 公司分部 VRF 的调用
- #
- interface GigabitEthernet0/0/0
- ip binding ***-instance ***13
- ip address 13.1.1.3 255.255.255.0
- #
注意: 调用 VRF 的时候, 该接口下的配置就会消失
- #
- interface GigabitEthernet0/0/0
- ip address 13.1.1.3 255.255.255.0
- #
- [R3-GigabitEthernet0/0/0]ip binding ***-instance ***13
- Nov 2 2019 14:59:50-08:00 R3 %%01IFNET/4/LINK_STATE(l)[3]:The line protocol IP on the interface GigabitEthernet0/0/0 has entered the DOWN state.
- Info: All IPv4 related configurations on this interface are removed!
- Info: All IPv6 related configurations on this interface are removed!
- [R3-GigabitEthernet0/0/0]dis this
- [V200R003C00]
- #
- interface GigabitEthernet0/0/0
- ip binding ***-instance ***13
- #
- [R3-GigabitEthernet0/0/0]ip address 13.1.1.3 24
- Nov 2 2019 15:00:02-08:00 R3 %%01IFNET/4/LINK_STATE(l)[4]:The line protocol IP on the interface GigabitEthernet0/0/0 has entered the UP state.
- [R3-GigabitEthernet0/0/0]
怎么样查看 VRF 的路由呢?
- [R3]display ip routing-table ***-instance ***13
- Route Flags: R - relay, D - download to fib
- ------------------------------------------------------------------------------
- Routing Tables: ***13
- Destinations : 6 Routes : 6
- Destination/Mask Proto Pre Cost Flags NextHop Interface
- 13.1.1.0/24 Direct 0 0 D 13.1.1.3 GigabitEthernet0/0/0
- 13.1.1.3/32 Direct 0 0 D 127.0.0.1 GigabitEthernet0/0/0
- 13.1.1.255/32 Direct 0 0 D 127.0.0.1 GigabitEthernet0/0/0
- 255.255.255.255/32 Direct 0 0 D 127.0.0.1 InLoopBack0
- [R3]
在 PE1 上面的全局路由表里面根本就看不到 13 网段的任何路由
- [R3]display ip routing-table
- Route Flags: R - relay, D - download to fib
- ------------------------------------------------------------------------------
- Routing Tables: Public
- Destinations : 11 Routes : 11
- Destination/Mask Proto Pre Cost Flags NextHop Interface
- 3.3.3.3/32 Direct 0 0 D 127.0.0.1 LoopBack0
- 4.4.4.4/32 OSPF 10 1 D 34.1.1.4 GigabitEthernet1/0/0
- 5.5.5.5/32 OSPF 10 2 D 34.1.1.4 GigabitEthernet1/0/0
- 34.1.1.0/24 Direct 0 0 D 34.1.1.3 GigabitEthernet1/0/0
- 34.1.1.3/32 Direct 0 0 D 127.0.0.1 GigabitEthernet1/0/0
- 34.1.1.255/32 Direct 0 0 D 127.0.0.1 GigabitEthernet1/0/0
- 45.1.1.0/24 OSPF 10 2 D 34.1.1.4 GigabitEthernet1/0/0
- 127.0.0.0/8 Direct 0 0 D 127.0.0.1 InLoopBack0
- 127.0.0.1/32 Direct 0 0 D 127.0.0.1 InLoopBack0
- 127.255.255.255/32 Direct 0 0 D 127.0.0.1 InLoopBack0
- 255.255.255.255/32 Direct 0 0 D 127.0.0.1 InLoopBack0
- [R3]
PE2 上面定义 A 公司总部 VRF 的调用
- #
- interface GigabitEthernet1/0/0
- ip binding ***-instance ***75
- ip address 57.1.1.5 255.255.255.0
- #
- [R5]display ip routing-table ***-instance ***75
- Route Flags: R - relay, D - download to fib
- ------------------------------------------------------------------------------
- Routing Tables: ***75
- Destinations : 6 Routes : 6
- Destination/Mask Proto Pre Cost Flags NextHop Interface
- 57.1.1.0/24 Direct 0 0 D 57.1.1.5 GigabitEthernet1/0/0
- 57.1.1.5/32 Direct 0 0 D 127.0.0.1 GigabitEthernet1/0/0
- 57.1.1.255/32 Direct 0 0 D 127.0.0.1 GigabitEthernet1/0/0
- 255.255.255.255/32 Direct 0 0 D 127.0.0.1 InLoopBack0
- [R5]display ip routing-table
- Route Flags: R - relay, D - download to fib
- ------------------------------------------------------------------------------
- Routing Tables: Public
- Destinations : 11 Routes : 11
- Destination/Mask Proto Pre Cost Flags NextHop Interface
- 3.3.3.3/32 OSPF 10 2 D 45.1.1.4 GigabitEthernet0/0/0
- 4.4.4.4/32 OSPF 10 1 D 45.1.1.4 GigabitEthernet0/0/0
- 5.5.5.5/32 Direct 0 0 D 127.0.0.1 LoopBack0
- 34.1.1.0/24 OSPF 10 2 D 45.1.1.4 GigabitEthernet0/0/0
- 45.1.1.0/24 Direct 0 0 D 45.1.1.5 GigabitEthernet0/0/0
- 45.1.1.5/32 Direct 0 0 D 127.0.0.1 GigabitEthernet0/0/0
- 45.1.1.255/32 Direct 0 0 D 127.0.0.1 GigabitEthernet0/0/0
- 127.0.0.0/8 Direct 0 0 D 127.0.0.1 InLoopBack0
- 127.0.0.1/32 Direct 0 0 D 127.0.0.1 InLoopBack0
- 127.255.255.255/32 Direct 0 0 D 127.0.0.1 InLoopBack0
- 255.255.255.255/32 Direct 0 0 D 127.0.0.1 InLoopBack0
在 PE1 和 PE2 上面分别对 B 公司的分部和总部进行定义 VRF
PE1 上面定义 B 公司分部
# ip ***-instance ***23 ipv4-family route-distinguisher 2:3 ***-target 200:400 export-extcommunity ***-target 200:400 import-extcommunity #
PE2 上面定义 B 公司总部
# ip ***-instance ***65 ipv4-family route-distinguisher 6:5 ***-target 200:400 export-extcommunity ***-target 200:400 import-extcommunity #
在 PE1 和 PE2 上面分别对 B 公司的分部和总部进行定义 VRF 调用
PE1 上面定义 B 公司分部 VRF 的调用
# interface GigabitEthernet0/0/1 ip binding ***-instance ***23 ip address 23.1.1.3 255.255.255.0 #
PE2 上面定义 B 公司总部 VRF 的调用
# interface GigabitEthernet0/0/1 ip binding ***-instance ***65 ip address 56.1.1.5 255.255.255.0 #
总结: 此时 PE1 和 PE2 上面有三张表
一个是 FIB 表 (全局路由表)
一个是 ***13 表
一个是 ***23 表
三张表之间的关系相互独立, 互不影响
6.CE1 和 PE1 之间的路由协议
注意: CE 和 PE 之间可以启用静态, RIP,OSPF,ISIS,BGP 协议
但是推荐启用 BGP 协议
CE1 的 BGP 的配置
# bgp 100 peer 13.1.1.3 as-number 500 # ipv4-family unicast undo synchronization network 1.1.1.1 255.255.255.255 peer 13.1.1.3 enable #
PE1 的 BGP 的配置
[R3-bgp]ipv4-family ? multicast Specify multicast address family
unicast Specify unicast address family 默认情况你的 BGP 都在单播里面
***-instance Specify *** instance 但是你要进入这个 ***-INSTANCE 视图里面去
***v4 Specify ***v4 address family [R3-bgp]ipv4-family ***-instance ***13 [R3-bgp-***13]dis this [V200R003C00] # # ipv4-family ***-instance ***13 peer 13.1.1.1 as-number 100 #
在 PE1 查看 BGP ***-instance 的关系
[R3]display bgp ***v4 ***-instance ***13 peer BGP local router ID : 3.3.3.3 Local AS number : 500 ***-Instance ***13, Router ID 3.3.3.3: Total number of peers : 1 Peers in established state : 1 Peer V AS MsgRcvd MsgSent OutQ Up/Down State PrefRcv 13.1.1.1 4 100 20 20 0 00:17:56 Established 1 [R1]display bgp peer BGP local router ID : 13.1.1.1 Local AS number : 100 Total number of peers : 1 Peers in established state : 1 Peer V AS MsgRcvd MsgSent OutQ Up/Down State PrefRcv 13.1.1.3 4 500 20 21 0 00:17:08 Established 1
检查在 PE1 上面是否学习到关于 CE1 设备的 1.1.1.1/32 的路由
[R3]display bgp ***v4 ***-instance ***13 routing-table BGP Local router ID is 3.3.3.3 Status codes: * - valid,> - best, d - damped, h - history, i - internal, s - suppressed, S - Stale Origin : i - IGP, e - EGP, ? - incomplete ***-Instance ***13, Router ID 3.3.3.3: Total Number of Routes: 2 Network NextHop MED LocPrf PrefVal Path/Ogn *> 1.1.1.1/32 13.1.1.1 0 0 100i
剩下的 CE2 和 PE2 之间的 BGP
R7 的 BGP 配置
# bgp 300 peer 57.1.1.5 as-number 500 # ipv4-family unicast undo synchronization network 7.7.7.7 255.255.255.255 peer 57.1.1.5 enable #
PE2BGP 的配置
[R5]bgp 500 [R5-bgp]ipv4-family ***-instance ***75 [R5-bgp-***75]DIS THIS [V200R003C00] # ipv4-family ***-instance ***75 peer 57.1.1.7 as-number 300 #
在 R7 上面进行检查
[R7]display bgp peer BGP local router ID : 57.1.1.7 Local AS number : 300 Total number of peers : 1 Peers in established state : 1 Peer V AS MsgRcvd MsgSent OutQ Up/Down State PrefRcv 57.1.1.5 4 500 90 88 0 01:25:01 Established 1 [R7]
在 PE2 上面进行检查
[R5-bgp]display bgp ***v4 ***-instance ***75 peer BGP local router ID : 45.1.1.5 Local AS number : 500 ***-Instance ***75, Router ID 45.1.1.5: Total number of peers : 1 Peers in established state : 1 Peer V AS MsgRcvd MsgSent OutQ Up/Down State PrefRcv 57.1.1.7 4 300 88 91 0 01:25:13 Established 1 [R5-bgp]display bgp ***v4 ***-instance ***75 routing-table BGP Local router ID is 45.1.1.5 Status codes: * - valid,> - best, d - damped, h - history, i - internal, s - suppressed, S - Stale Origin : i - IGP, e - EGP, ? - incomplete ***-Instance ***75, Router ID 45.1.1.5: Total Number of Routes: 2 Network NextHop MED LocPrf PrefVal Path/Ogn *> 7.7.7.7/32 57.1.1.7 0 0 300i [R5-bgp]
剩下的 CE3 和 PE1 之间的 BGP
# bgp 200 peer 23.1.1.3 as-number 500 # ipv4-family unicast undo synchronization network 2.2.2.2 255.255.255.255 peer 23.1.1.3 enable # return [R2-bgp] [R3]bgp 500 [R3-bgp]ip [R3-bgp]ipv4-family *** [R3-bgp]ipv4-family ***v4 [R3-bgp]ipv4-family ***-instance ***23 [R3-bgp-***23] [R3-bgp-***23] [R3-bgp-***23]dis this [V200R003C00] # # ipv4-family ***-instance ***23 peer 23.1.1.2 as-number 200 # return [R3-bgp-***23] [R2]display bgp peer BGP local router ID : 23.1.1.2 Local AS number : 200 Total number of peers : 1 Peers in established state : 1 Peer V AS MsgRcvd MsgSent OutQ Up/Down State PrefRcv 23.1.1.3 4 500 91 91 0 01:28:11 Established 1 [R3-bgp]display bgp ***v4 ***-instance ***23 peer BGP local router ID : 3.3.3.3 Local AS number : 500 ***-Instance ***23, Router ID 3.3.3.3: Total number of peers : 1 Peers in established state : 1 Peer V AS MsgRcvd MsgSent OutQ Up/Down State PrefRcv 23.1.1.2 4 200 91 92 0 01:28:28 Established 1 [R3-bgp]display bgp ***v4 ***-instance ***23 rou [R3-bgp]display bgp ***v4 ***-instance ***23 routing-table BGP Local router ID is 3.3.3.3 Status codes: * - valid,> - best, d - damped, h - history, i - internal, s - suppressed, S - Stale Origin : i - IGP, e - EGP, ? - incomplete ***-Instance ***23, Router ID 3.3.3.3: Total Number of Routes: 2 Network NextHop MED LocPrf PrefVal Path/Ogn *> 2.2.2.2/32 23.1.1.2 0 0 200i *>i 6.6.6.6/32 5.5.5.5 0 100 0 400i
剩下的 CE4 和 PE2 之间的 BGP
bgp 400 peer 56.1.1.5 as-number 500 # ipv4-family unicast undo synchronization network 6.6.6.6 255.255.255.255 peer 56.1.1.5 enable # [R5-bgp] [R5-bgp]bgp 500 [R5-bgp]ip [R5-bgp]ipv6-family [R5-bgp]ipv4-family *** [R5-bgp]ipv4-family ***v4 [R5-bgp]ipv4-family ***-instance *** [R5-bgp]ipv4-family ***-instance ***65 [R5-bgp-***65]dis this [V200R003C00] # # ipv4-family ***-instance ***65 peer 56.1.1.6 as-number 400 # return [R5-bgp-***65] [R6]display bgp peer BGP local router ID : 56.1.1.6 Local AS number : 400 Total number of peers : 1 Peers in established state : 1 Peer V AS MsgRcvd MsgSent OutQ Up/Down State PrefRcv 56.1.1.5 4 500 93 94 0 01:30:21 Established 1 [R5-bgp]display bgp ***v4 ***-instance ***65 peer BGP local router ID : 45.1.1.5 Local AS number : 500 ***-Instance ***65, Router ID 45.1.1.5: Total number of peers : 1 Peers in established state : 1 Peer V AS MsgRcvd MsgSent OutQ Up/Down State PrefRcv 56.1.1.6 4 400 93 93 0 01:30:35 Established 1 [R5-bgp]display bgp ***v4 ***-instance ***65 rou [R5-bgp]display bgp ***v4 ***-instance ***65 routing-table BGP Local router ID is 45.1.1.5 Status codes: * - valid,> - best, d - damped, h - history, i - internal, s - suppressed, S - Stale Origin : i - IGP, e - EGP, ? - incomplete ***-Instance ***65, Router ID 45.1.1.5: Total Number of Routes: 2 Network NextHop MED LocPrf PrefVal Path/Ogn *>i 2.2.2.2/32 3.3.3.3 0 100 0 200i *> 6.6.6.6/32 56.1.1.6 0 0 400i
7.PE1 和 PE2 之间建立 MP-BGP 的关系
在 PE1 上面的配置
7.PE1 和 PE2 之间建立 MP-BGP 的关系
在 PE1 上面的配置
bgp 500 undo default ipv4-unicast peer 5.5.5.5 as-number 500 peer 5.5.5.5 connect-interface LoopBack0 # ipv4-family unicast undo synchronization peer 5.5.5.5 enable peer 5.5.5.5 next-hop-local # ipv4-family ***v4 policy ***-target
peer 5.5.5.5 enable 因为 PE 设备之间的路由是 ***V4 的路由
#
在 PE2 上面的配置
bgp 500 peer 3.3.3.3 as-number 500 peer 3.3.3.3 connect-interface LoopBack0 # ipv4-family unicast undo synchronization peer 3.3.3.3 enable peer 3.3.3.3 next-hop-local # ipv4-family ***v4 policy ***-target peer 3.3.3.3 enable #
检查 MP-BGP 的关系
[R3]display bgp ***v4 all peer BGP local router ID : 3.3.3.3 Local AS number : 500 Total number of peers : 3 Peers in established state : 3 Peer V AS MsgRcvd MsgSent OutQ Up/Down State PrefRcv 5.5.5.5 4 500 98 101 0 01:34:50 Established 2 Peer of IPv4-family for *** instance : ***-Instance ***13, Router ID 3.3.3.3: 13.1.1.1 4 100 36 36 0 00:33:30 Established 1 ***-Instance ***23, Router ID 3.3.3.3: 23.1.1.2 4 200 98 99 0 01:35:22 Established 1 [R5]display bgp ***v4 all peer BGP local router ID : 45.1.1.5 Local AS number : 500 Total number of peers : 3 Peers in established state : 3 Peer V AS MsgRcvd MsgSent OutQ Up/Down State PrefRcv 3.3.3.3 4 500 104 102 0 01:38:29 Established 2 Peer of IPv4-family for *** instance : ***-Instance ***65, Router ID 45.1.1.5: 56.1.1.6 4 400 102 102 0 01:39:01 Established 1 ***-Instance ***75, Router ID 45.1.1.5: 57.1.1.7 4 300 101 104 0 01:38:40 Established 1
在 R3 上面查看我们 ***V4 的路由表 R3 上面都会学习到各个站点的 VRF 的 ***V4 路由, 但是 R3 这边他会根据各个 VRF 路由里面所携带的 RD 和 RT 参数, R3 就是把各自的路由放入到各自的 ***-Instance 当中
[R3]display bgp ***v4 all routing-table BGP Local router ID is 3.3.3.3 Status codes: * - valid,> - best, d - damped, h - history, i - internal, s - suppressed, S - Stale Origin : i - IGP, e - EGP, ? - incomplete Total number of routes from all PE: 4 Route Distinguisher: 1:3 Network NextHop MED LocPrf PrefVal Path/Ogn *> 1.1.1.1/32 13.1.1.1 0 0 100i Route Distinguisher: 2:3 Network NextHop MED LocPrf PrefVal Path/Ogn *> 2.2.2.2/32 23.1.1.2 0 0 200i Route Distinguisher: 6:5 Network NextHop MED LocPrf PrefVal Path/Ogn *>i 6.6.6.6/32 5.5.5.5 0 100 0 400i Route Distinguisher: 7:5 Network NextHop MED LocPrf PrefVal Path/Ogn *>i 7.7.7.7/32 5.5.5.5 0 100 0 300i ***-Instance ***13, Router ID 3.3.3.3: Total Number of Routes: 2 Network NextHop MED LocPrf PrefVal Path/Ogn *> 1.1.1.1/32 13.1.1.1 0 0 100i *>i 7.7.7.7/32 5.5.5.5 0 100 0 300i ***-Instance ***23, Router ID 3.3.3.3: Total Number of Routes: 2 Network NextHop MED LocPrf PrefVal Path/Ogn *> 2.2.2.2/32 23.1.1.2 0 0 200i *>i 6.6.6.6/32 5.5.5.5 0 100 0 400i
8. 在各个站点进行测试
<R1>display ip routing-table Route Flags: R - relay, D - download to fib ------------------------------------------------------------------------------ Routing Tables: Public Destinations : 9 Routes : 9 Destination/Mask Proto Pre Cost Flags NextHop Interface 1.1.1.1/32 Direct 0 0 D 127.0.0.1 LoopBack0 7.7.7.7/32 EBGP 255 0 D 13.1.1.3 GigabitEthernet0/0/0 13.1.1.0/24 Direct 0 0 D 13.1.1.1 GigabitEthernet0/0/0 13.1.1.1/32 Direct 0 0 D 127.0.0.1 GigabitEthernet0/0/0 13.1.1.255/32 Direct 0 0 D 127.0.0.1 GigabitEthernet0/0/0 127.0.0.0/8 Direct 0 0 D 127.0.0.1 InLoopBack0 127.0.0.1/32 Direct 0 0 D 127.0.0.1 InLoopBack0 127.255.255.255/32 Direct 0 0 D 127.0.0.1 InLoopBack0 255.255.255.255/32 Direct 0 0 D 127.0.0.1 InLoopBack0 <R1>ping -a 1.1.1.1 7.7.7.7 PING 7.7.7.7: 56 data bytes, press CTRL_C to break Reply from 7.7.7.7: bytes=56 Sequence=1 ttl=252 time=40 ms Reply from 7.7.7.7: bytes=56 Sequence=2 ttl=252 time=40 ms Reply from 7.7.7.7: bytes=56 Sequence=3 ttl=252 time=70 ms Reply from 7.7.7.7: bytes=56 Sequence=4 ttl=252 time=40 ms Reply from 7.7.7.7: bytes=56 Sequence=5 ttl=252 time=30 ms --- 7.7.7.7 ping statistics --- 5 packet(s) transmitted 5 packet(s) received 0.00% packet loss round-trip min/avg/max = 30/44/70 ms
其他连通性略
在 PE2 上面的配置
bgp 500 peer 3.3.3.3 as-number 500 peer 3.3.3.3 connect-interface LoopBack0 # ipv4-family unicast undo synchronization peer 3.3.3.3 enable peer 3.3.3.3 next-hop-local # ipv4-family ***v4 policy ***-target peer 3.3.3.3 enable #
检查 MP-BGP 的关系
<R1>display ip routing-table Route Flags: R - relay, D - download to fib ------------------------------------------------------------------------------ Routing Tables: Public Destinations : 9 Routes : 9 Destination/Mask Proto Pre Cost Flags NextHop Interface 1.1.1.1/32 Direct 0 0 D 127.0.0.1 LoopBack0 7.7.7.7/32 EBGP 255 0 D 13.1.1.3 GigabitEthernet0/0/0 13.1.1.0/24 Direct 0 0 D 13.1.1.1 GigabitEthernet0/0/0 13.1.1.1/32 Direct 0 0 D 127.0.0.1 GigabitEthernet0/0/0 13.1.1.255/32 Direct 0 0 D 127.0.0.1 GigabitEthernet0/0/0 127.0.0.0/8 Direct 0 0 D 127.0.0.1 InLoopBack0 127.0.0.1/32 Direct 0 0 D 127.0.0.1 InLoopBack0 127.255.255.255/32 Direct 0 0 D 127.0.0.1 InLoopBack0 255.255.255.255/32 Direct 0 0 D 127.0.0.1 InLoopBack0 <R1>ping -a 1.1.1.1 7.7.7.7 PING 7.7.7.7: 56 data bytes, press CTRL_C to break Reply from 7.7.7.7: bytes=56 Sequence=1 ttl=252 time=40 ms Reply from 7.7.7.7: bytes=56 Sequence=2 ttl=252 time=40 ms Reply from 7.7.7.7: bytes=56 Sequence=3 ttl=252 time=70 ms Reply from 7.7.7.7: bytes=56 Sequence=4 ttl=252 time=40 ms Reply from 7.7.7.7: bytes=56 Sequence=5 ttl=252 time=30 ms --- 7.7.7.7 ping statistics --- 5 packet(s) transmitted 5 packet(s) received 0.00% packet loss round-trip min/avg/max = 30/44/70 ms
在 R3 上面查看我们 ***V4 的路由表 R3 上面都会学习到各个站点的 VRF 的 ***V4 路由, 但是 R3 这边他会根据各个 VRF 路由里面所携带的 RD 和 RT 参数, R3 就是把各自的路由放入到各自的 ***-Instance 当中
[R3]display bgp ***v4 all routing-table BGP Local router ID is 3.3.3.3 Status codes: * - valid,> - best, d - damped, h - history, i - internal, s - suppressed, S - Stale Origin : i - IGP, e - EGP, ? - incomplete Total number of routes from all PE: 4 Route Distinguisher: 1:3 Network NextHop MED LocPrf PrefVal Path/Ogn *> 1.1.1.1/32 13.1.1.1 0 0 100i Route Distinguisher: 2:3 Network NextHop MED LocPrf PrefVal Path/Ogn *> 2.2.2.2/32 23.1.1.2 0 0 200i Route Distinguisher: 6:5 Network NextHop MED LocPrf PrefVal Path/Ogn *>i 6.6.6.6/32 5.5.5.5 0 100 0 400i Route Distinguisher: 7:5 Network NextHop MED LocPrf PrefVal Path/Ogn *>i 7.7.7.7/32 5.5.5.5 0 100 0 300i ***-Instance ***13, Router ID 3.3.3.3: Total Number of Routes: 2 Network NextHop MED LocPrf PrefVal Path/Ogn *> 1.1.1.1/32 13.1.1.1 0 0 100i *>i 7.7.7.7/32 5.5.5.5 0 100 0 300i ***-Instance ***23, Router ID 3.3.3.3: Total Number of Routes: 2 Network NextHop MED LocPrf PrefVal Path/Ogn *> 2.2.2.2/32 23.1.1.2 0 0 200i *>i 6.6.6.6/32 5.5.5.5 0 100 0 400i
8. 在各个站点进行测试
<R1>display ip routing-table Route Flags: R - relay, D - download to fib ------------------------------------------------------------------------------ Routing Tables: Public Destinations : 9 Routes : 9 Destination/Mask Proto Pre Cost Flags NextHop Interface 1.1.1.1/32 Direct 0 0 D 127.0.0.1 LoopBack0 7.7.7.7/32 EBGP 255 0 D 13.1.1.3 GigabitEthernet0/0/0 13.1.1.0/24 Direct 0 0 D 13.1.1.1 GigabitEthernet0/0/0 13.1.1.1/32 Direct 0 0 D 127.0.0.1 GigabitEthernet0/0/0 13.1.1.255/32 Direct 0 0 D 127.0.0.1 GigabitEthernet0/0/0 127.0.0.0/8 Direct 0 0 D 127.0.0.1 InLoopBack0 127.0.0.1/32 Direct 0 0 D 127.0.0.1 InLoopBack0 127.255.255.255/32 Direct 0 0 D 127.0.0.1 InLoopBack0 255.255.255.255/32 Direct 0 0 D 127.0.0.1 InLoopBack0 <R1>ping -a 1.1.1.1 7.7.7.7 PING 7.7.7.7: 56 data bytes, press CTRL_C to break Reply from 7.7.7.7: bytes=56 Sequence=1 ttl=252 time=40 ms Reply from 7.7.7.7: bytes=56 Sequence=2 ttl=252 time=40 ms Reply from 7.7.7.7: bytes=56 Sequence=3 ttl=252 time=70 ms Reply from 7.7.7.7: bytes=56 Sequence=4 ttl=252 time=40 ms Reply from 7.7.7.7: bytes=56 Sequence=5 ttl=252 time=30 ms --- 7.7.7.7 ping statistics --- 5 packet(s) transmitted 5 packet(s) received 0.00% packet loss round-trip min/avg/max = 30/44/70 ms
其他连通性略
来源: http://www.bubuko.com/infodetail-3323042.html