PE1:
P1:
ASBR1:
ASBR1:
[ASBR1]bgp 100
[ASBR1-bgp]peer 10.1.45.5 as 200
[ASBR1-bgp-af-vpnv4]peer 10.1.45.5 enable
[ASBR1-bgp]network 2.2.2.2 32
ASBR2:
[ASBR2]bgp 200
[ASBR2-bgp]peer 10.1.45.4 as 100
[ASBR2-bgp-af-vpnv4]peer 10.1.45.4 enable
[ASBR2-bgp]network 7.7.7.7 32
ASBR1:
bgp 100
peer 2.2.2.2 as-number 100
peer 2.2.2.2 connect-interface LoopBack0PE1:
bgp 100
peer 4.4.4.4 as-number 100
peer 4.4.4.4 connect-interface LoopBack0
ASBR1:
[ASBR1]int g0/0/1
[ASBR1-GigabitEthernet0/0/1]mpls
[ASBR1-GigabitEthernet0/0/1]mpls ldp
ASBR2:
[ASBR2]int g0/0/0
[ASBR2-GigabitEthernet0/0/0]mpls
[ASBR2-GigabitEthernet0/0/0]mpls ldp
PE1:
[PE1]bgp 100
[PE1-bgp]peer 4.4.4.4 label-route-capability
ASBR1:
[ASBR1-bgp]peer 2.2.2.2 label-route-capability
[ASBR1-bgp]peer 10.1.45.5 label-route-capability
ASBR1:
[ASBR1-bgp] peer 10.1.45.5 route-policy label-export export
[ASBR1]route-policy label-export permit node 10
[ASBR1-route-policy]apply mpls-label
ASBR2:
[ASBR2-bgp]peer 10.1.45.4 route-policy lable-export export
[ASBR2]route-policy lable-export permit node 10
[ASBR2-route-policy]apply mpls-label
发现现在的路由携带着标签,意思就是说如果ASBR2收到标签为1027的就说明是去往目的地址7.7.7.7的,然后下一跳地址的话是往10.1.45.5发,也就是ASBR2,同理另外一边也是如此
ASBR1:
[ASBR1-bgp]peer 2.2.2.2 route-policy lable-sw export
[ASBR1]route-policy lable-sw permit node 10
[ASBR1-route-policy]if-match mpls-label
[ASBR1-route-policy]apply mpls-label
ASBR2:
跟ASBR1同理
[ASBR2-bgp]peer 7.7.7.7 route-policy lable-sw export
[ASBR2]route-policy lable-sw permit node 10
[ASBR2-route-policy]if-match mpls-label
[ASBR2-route-policy]apply mpls-label
针对于ASBR而言,对于发送给PE1的路由就替换掉标签,但是对于PE1而言,去往7.7.7.7就往4.4.4.4发即可
PE1:
[PE1]bgp 100
[PE1-bgp]peer 7.7.7.7 as 200
[PE1-bgp]peer 7.7.7.7 co lo 0
[PE1-bgp]peer 7.7.7.7 ebgp-max-hop 6
[PE1-bgp]ipv4-family vpnv4
[PE1-bgp-af-vpnv4]peer 7.7.7.7 enable
PE2:
[PE2]bgp 200
[PE2-bgp]peer 2.2.2.2 as 100
[PE2-bgp]peer 2.2.2.2 connect-interface lo 0
[PE2-bgp]peer 2.2.2.2 ebgp-max-hop 6
[PE2-bgp]ipv4-family vpnv4
[PE2-bgp-af-vpnv4]peer 2.2.2.2 enable
发现CE已经有了另外一个MPLS域的CE的路由了,而且也可以正常ping通了
optionc对于optionb和c来说相对来说较复杂,但是复杂不能把我们打败,调整好心态冷静下来一步一步来,慢慢捋一下,注意一些细节的部分,在配置中我遇到了一些细节上的问题,比如说LDP的接口配置错误了,结果导致大半天的时间都在排错,建议的话一边配置的同时一边做好笔记,账号好配置的思路即可掌握