目录
配置各域内IGP路由互通以及MPLS LDP协议
PE1:G0/1口宣告进ISIS 1,并开启MPLS LDP协议
P2:G0/1口、G0/0口宣告进ISIS 10,并开启MPLS LDP协议
ASBR3:G0/0口宣告进ISIS 1,并开启MPLS LDP协议
PE6:G0/1口宣告进ISIS 10
P5:G0/1口、G0/0口宣告进ISIS 10
ASBR4:G0/0口宣告进ISIS 10
Show ip router此时检查各自的IGP路由是否域内可达
PE1和ASBR3建立IBGP邻居关系
PE1
router bgp 100
bgp router-id 1.1.1.1
neighbor 3.3.3.3 remote-as 100
neighbor 3.3.3.3 update-source loop 0
router bgp 100
bgp router-id 3.3.3.3
neighbor 1.1.1.1 remote-as 100
neighbor 1.1.1.1 update-source loop 0
PE6和ASBR4建立IBGP邻居关系
PE6
router bgp 200
bgp router-id 6.6.6.6
neighbor 4.4.4.4 remote-as 200
neighbor 4.4.4.4 update-source loop 0
ASBR4
router bgp 200
bgp router-id 4.4.4.4
neighbor 6.6.6.6 remote-as 200
neighbor 6.6.6.6 update-source loop 0
ASBR3和ASSBR4建立EBGP邻居关系
ASBR3
router bgp 100
neighbor 1.0.34.4 remote-as 200
router bgp 200
neighbor 1.0.34.3 remote-as 100
Show ip bgp summary此时检查各自的BGP邻居是否都已经建立成功
配置路由宣告使得PE之间相互获得各自的IP地址
在ASBR3上宣告PE1的地址传递给ASBR4,再由ASBR4传递给PE2
router bgp 100
net 1.1.1.1
neighbor 1.1.1.1 next-hop-self
由于从ASBR4(EBGP)传递过来的路由再传递给PE1(IBGP)时默认不更改下一跳
此时PE1收到后没有去往ASBR4的地址,会造成路由不可达
在ASBR4上宣告PE6的地址传递给ASBR3,再由ASBR3传递给PE1
router bgp 200
net 6.6.6.6
neighbor 6.6.6.6 next-hop-self
Show ip route 查看是否已经获得了对端PE的IP地址(通过此地址建立Vpnv4邻居)
PE1的配置(通过Loop接口建立EBGP邻居,需要更改最大跳数和路由更新源)
router bgp 100
bgp router-id 1.1.1.1
neighbor 6.6.6.6 remote-as 200
neighbor 6.6.6.6 update-source loop 0
neighbor 6.6.6.6 ebgp-multihop 10
address-family vpnv4 unicast
neighbor 6.6.6.6 activate 激活Vpnv4邻居关系
neighbor 6.6.6.6 send-community extended 传递RT值
address-family ipv4 unicast
no neighbor 6.6.6.6 activate 取消IPv4邻居关系
PE6的配置
router bgp 200
bgp router-id 6.6.6.6
neighbor 1.1.1.1 remote-as 100
neighbor 1.1.1.1 update-source loop 0
neighbor 1.1.1.1 ebgp-multihop 10
address-family vpnv4 unicast
neighbor 1.1.1.1 activate
neighbor 1.1.1.1 send-community extended
address-family ipv4 unicast
no neighbor 1.1.1.1 activate
Show bgp vpnv4 unicast all summary 查看Vpnv4邻居是否已经建立成功(发现此时邻居还没有建立成功)--需要建立标签
PE1标签→PE6
ASBR3设备上匹配PE1的地址,为其分配传递给ASBR4
ASBR4设备收到带有标签的BGP路由后,为其重新分配标签发送给PE6(P设备没有对端PE的路由)
PE6标签→PE1
ASBR4设备上匹配PE6的地址,为其分配传递给ASBR3
ASBR3设备收到带有标签的BGP路由后,为其重新分配标签发送给PE1(P设备没有对端PE的路由)
ASBR3设备配置
通过ACL配置匹配条件匹配PE1地址
ip access-list standard 10
10 permit host 1.1.1.1
20 deny any
配置路由策略1(此路由策略作用是传递标签到ASBR4)
route-map Label-1 permit 10
match ip address 10
set mpls-label
配置路由策略2(此路由策略作用是收到ASBR4的标签后重新将标签传递给PE1)
route-map Label-2 permit 10
match mpls-label
set mpls-label
router bgp 100
address-family ipv4
neighbor 1.0.34.4 send-label 配置与ASBR4开启标签交互
neighbor 1.1.1.1 send-label 配置与PE1开启标签交互
neighbor 1.0.34.4 route-map Label-1 out 配置向ASBR4传递1.1.1.1路由时分配标签
neighbor 1.1.1.1 route-map Label-2 out 配置向PE1传递标签路由时重新分配标签
通过ACL配置匹配条件匹配PE6地址
ip access-list standard 10
10 permit host 6.6.6.6
20 deny
route-map Label-1 permit 10
match ip address 10
set mpls-label
配置路由策略2(此路由策略作用是收到ASBR3的标签后重新将标签传递给PE6)
route-map Label-2 permit 10
match mpls-label
set mpls-label
router bgp 200
address-family ipv4
neighbor 1.0.34.3 send-label 配置与ASBR3开启标签交互
neighbor 6.6.6.6 send-label 配置与PE6开启标签交互
neighbor 1.0.34.3 route-map Label-1 out 配置向ASBR4传递1.1.1.1路由时分配标签
neighbor 6.6.6.6 route-map Label-2 out 配置向PE1传递标签路由时重新分配标签
此时我们查看标签转发表,发现ASBR3有PE1的标签转发表,但是传不到ASBR4
此时,我们就需要在ASBR之间相连的接口上开启标签转发(默认不开启标签转发)
int g0/1
label-switching
Show mpls forwarding 查看ASBR上是否有关于PE的标签
此时PE设备接收不到ASBR传递过来的路由,PE需要针对ASBR开启标签交换功能
PE1
ruoter bgp 100
neighbor 3.3.3.3 send-label
PE6
router bgp 200
neighbor 4.4.4.4 send-label
Show mpls forwarding 查看PE上是否有关于对端的标签
Show bgp vpnv4 unicast all summary 查看Vpnv4邻居是否已经建立成功
以PE1与其CE8为例子(与单域配置相同)此处运行BGP协议
PE1配置实例
ip vrf VPN-1
rd 100:1
route-target export 200:1
route-target import 100:1
PE1将实例绑定接口
int g0/0
ip vrf forwarding VPN-1
ip add 1.0.18.1 24
PE1配置与CE对接的路由协议并绑定实例
route ospf 1 vrf VPN-1
area 0
network 1.0.18.0 0.0.0.255 area 0
PE1将OSPF实例引入到BGP传递给Vpnv4邻居
router bgp 100
address-family ipv4 vrf VPN-1
redistribute ospf 1 match internal external
PE1将BGP路由引入到OSPF实例传递给CE
router ospf 1 vrf VPN-1
redistribute bgp subnets
CE8配置与PE之间的路由协议
router ospf 1
area 0
network 8.8.8.8 0.0.0.0 area 0
network 1.0.18.8 0.0.0.0 area 0
此时CE已经获取到其它站点的地址,并且可以访问了
show ip route 查看CE上是否有其它站点的路由