R1:
dis current-configuration
[V200R003C00]
snmp-agent local-engineid 800007DB03000000000000
snmp-agent
clock timezone China-Standard-Time minus 08:00:00
ip vpn-instance vpn1 //添加vpn实例vpn1
ipv4-family
route-distinguisher 1:1 //RD标签
vpn-target 100:1 export-extcommunity //RT进、出 标签
vpn-target 100:1 import-extcommunity
mpls lsr-id 1.1.1.1
//必须先设置mpls lsr-id才能开mpls,而且一定要环回接口32位的地址才能当这个lsr-id
mpls
mpls ldp
isis 1 //IGP采用isis打通
network-entity 49.000.0000.0000.0001.00
interface GigabitEthernet0/0/0
ip binding vpn-instance vpn1
ip address 17.1.1.1 255.255.255.0
interface GigabitEthernet0/0/1
ip address 12.1.1.1 255.255.255.0
isis enable 1
mpls //接口下也要开mpls ldp
mpls ldp
interface GigabitEthernet0/0/2
ip address 13.1.1.1 255.255.255.0
isis enable 1
mpls
mpls ldp
interface NULL0
interface LoopBack0
ip address 1.1.1.1 255.255.255.255
isis enable 1
bgp 100
peer 2.2.2.2 as-number 100
peer 2.2.2.2 connect-interface LoopBack0
ipv4-family unicast
undo synchronization
peer 2.2.2.2 enable
peer 2.2.2.2 label-route-capability //在把ce路由发送给2.2.2.2 RR时开标签传递能力
ipv4-family vpnv4
policy vpn-target
peer 2.2.2.2 enable //建立vpnv4邻居
ipv4-family vpn-instance vpn1
peer 17.1.1.7 as-number 1 //和ce建立ebgp邻居
R2:
dis current-configuration
[V200R003C00]
mpls lsr-id 2.2.2.2
mpls
mpls ldp
isis 1
network-entity 49.0000.0000.0000.0002.00
firewall zone Local
priority 15
interface GigabitEthernet0/0/0
ip address 12.1.1.2 255.255.255.0
isis enable 1
mpls
mpls ldp
interface GigabitEthernet0/0/1
ip address 23.1.1.2 255.255.255.0
isis enable 1
mpls
mpls ldp
interface GigabitEthernet0/0/2
interface NULL0
interface LoopBack0
ip address 2.2.2.2 255.255.255.255
isis enable 1
bgp 100
peer 1.1.1.1 as-number 100
peer 1.1.1.1 connect-interface LoopBack0
peer 3.3.3.3 as-number 100
peer 3.3.3.3 connect-interface LoopBack0
peer 5.5.5.5 as-number 200
peer 5.5.5.5 ebgp-max-hop 255
peer 5.5.5.5 connect-interface LoopBack0
ipv4-family unicast
undo synchronization
peer 1.1.1.1 enable
peer 1.1.1.1 next-hop-invariable
//设置在学到另一个域中的路由进行RR反射时不改变下一跳,用于控制让数据平在不走RR经过。
peer 1.1.1.1 label-route-capability //重新打标签
peer 3.3.3.3 enable
peer 3.3.3.3 label-route-capability //重新打标签
undo peer 5.5.5.5 enable //闭掉对端的单播路由功能,用于配合上面让数据不走RR
ipv4-family vpnv4
undo policy vpn-target //关掉标签过滤功能
peer 1.1.1.1 enable
peer 1.1.1.1 reflect-clien
peer 3.3.3.3 enable
peer 3.3.3.3 reflect-clien
peer 5.5.5.5 enable
R3:
dis current-configuration
mpls lsr-id 3.3.3.3
mpls
mpls ldp
isis 1
network-entity 49.0000.0000.0000.0003.00
firewall zone Local
priority 15
interface GigabitEthernet0/0/0
ip address 23.1.1.3 255.255.255.0
isis enable 1
mpls
mpls ldp
interface GigabitEthernet0/0/1
ip address 34.1.1.3 255.255.255.0
mpls
interface GigabitEthernet0/0/2
ip address 13.1.1.3 255.255.255.0
isis enable 1
mpls
mpls ldp
interface NULL0
interface LoopBack0
ip address 3.3.3.3 255.255.255.255
isis enable 1
bgp 100
peer 2.2.2.2 as-number 100
peer 2.2.2.2 connect-interface LoopBack0
peer 34.1.1.4 as-number 200
ipv4-family unicast
undo synchronization
network 1.1.1.1 255.255.255.255
network 2.2.2.2 255.255.255.255
peer 2.2.2.2 enable
peer 2.2.2.2 route-policy rr export .//对RR发送路由时打上标签
peer 2.2.2.2 next-hop-local
peer 2.2.2.2 label-route-capability //开启标签传递能力
peer 34.1.1.4 enable
peer 34.1.1.4 route-policy asbr export //对对端域ebgp传递路由时打上标签
peer 34.1.1.4 label-route-capability
ipv4-family vpnv4
undo policy vpn-target
route-policy asbr permit node 10 //传递给对面域时路由时打上mpls标签
apply mpls-label
route-policy rr permit node 20 //传递给RR路由时打上mpls标签
apply mpls-label
R4:
dis current-configuration
[V200R003C00]
snmp-agent local-engineid 800007DB03000000000000
snmp-agent
clock timezone China-Standard-Time minus 08:00:00
portal local-server load flash:/portalpage.zip
drop illegal-mac alarm
wlan ac-global carrier id other ac id 0
set cpu-usage threshold 80 restore 75
mpls lsr-id 4.4.4.4
mpls
mpls ldp
isis 1
network-entity 49.0000.0000.0000.0004.00
firewall zone Local
priority 15
interface GigabitEthernet0/0/0
ip address 34.1.1.4 255.255.255.0
mpls
interface GigabitEthernet0/0/1
ip address 45.1.1.4 255.255.255.0
isis enable 1
mpls
mpls ldp
interface GigabitEthernet0/0/2
ip address 46.1.1.4 255.255.255.0
isis enable 1
mpls
mpls ldp
interface NULL0
interface LoopBack0
ip address 4.4.4.4 255.255.255.255
isis enable 1
bgp 200
peer 5.5.5.5 as-number 200
peer 5.5.5.5 connect-interface LoopBack0
peer 34.1.1.3 as-number 100
ipv4-family unicast
undo synchronization
network 5.5.5.5 255.255.255.255
network 6.6.6.6 255.255.255.255
peer 5.5.5.5 enable
peer 5.5.5.5 route-policy rr export
peer 5.5.5.5 next-hop-local
peer 5.5.5.5 label-route-capability
peer 34.1.1.3 enable
peer 34.1.1.3 route-policy asbr export
peer 34.1.1.3 label-route-capability
ipv4-family vpnv4
undo policy vpn-target
route-policy rr permit node 10
apply mpls-label
route-policy asbr permit node 10
apply mpls-label
R5:
dis current-configuration
[V200R003C00]
snmp-agent local-engineid 800007DB03000000000000
snmp-agent
clock timezone China-Standard-Time minus 08:00:00
portal local-server load flash:/portalpage.zip
drop illegal-mac alarm
wlan ac-global carrier id other ac id 0
set cpu-usage threshold 80 restore 75
mpls lsr-id 5.5.5.5
mpls
mpls ldp
isis 1
network-entity 49.0000.0000.0000.0005.00
firewall zone Local
priority 15
interface GigabitEthernet0/0/0
ip address 45.1.1.5 255.255.255.0
isis enable 1
mpls
mpls ldp
interface GigabitEthernet0/0/1
ip address 56.1.1.5 255.255.255.0
isis enable 1
mpls
mpls ldp
interface GigabitEthernet0/0/2
interface NULL0
interface LoopBack0
ip address 5.5.5.5 255.255.255.255
isis enable 1
bgp 200
peer 2.2.2.2 as-number 100
peer 2.2.2.2 ebgp-max-hop 255
peer 2.2.2.2 connect-interface LoopBack0
peer 4.4.4.4 as-number 200
peer 4.4.4.4 connect-interface LoopBack0
peer 6.6.6.6 as-number 200
peer 6.6.6.6 connect-interface LoopBack0
ipv4-family unicast
undo synchronization
undo peer 2.2.2.2 enable
peer 4.4.4.4 enable
peer 4.4.4.4 label-route-capability
peer 6.6.6.6 enable
peer 6.6.6.6 next-hop-invariable
peer 6.6.6.6 label-route-capability
ipv4-family vpnv4
undo policy vpn-target
peer 2.2.2.2 enable
peer 4.4.4.4 reflect-clien
peer 4.4.4.4 enable
peer 6.6.6.6 enable
peer 6.6.6.6 reflect-clien
R6:
dis current-configuration
[V200R003C00]
snmp-agent local-engineid 800007DB03000000000000
snmp-agent
clock timezone China-Standard-Time minus 08:00:00
portal local-server load flash:/portalpage.zip
drop illegal-mac alarm
wlan ac-global carrier id other ac id 0
set cpu-usage threshold 80 restore 75
ip vpn-instance vpn1
ipv4-family
route-distinguisher 1:1
vpn-target 100:1 export-extcommunity
vpn-target 100:1 import-extcommunity
mpls lsr-id 6.6.6.6
mpls
mpls ldp
isis 1
network-entity 49.0000.0000.0000.0006.00
firewall zone Local
priority 15
interface GigabitEthernet0/0/0
ip address 56.1.1.6 255.255.255.0
isis enable 1
mpls
mpls ldp
interface GigabitEthernet0/0/1
ip binding vpn-instance vpn1
ip address 68.1.1.6 255.255.255.0
interface GigabitEthernet0/0/2
ip address 46.1.1.6 255.255.255.0
isis enable 1
mpls
mpls ldp
interface NULL0
interface LoopBack0
ip address 6.6.6.6 255.255.255.255
isis enable 1
bgp 200
peer 5.5.5.5 as-number 200
peer 5.5.5.5 connect-interface LoopBack0
ipv4-family unicast
undo synchronization
peer 5.5.5.5 enable
peer 5.5.5.5 label-route-capability
ipv4-family vpnv4
policy vpn-target
peer 5.5.5
.5
enable
ipv4-family vpn-instance vpn1
peer 68.1.1.8 as-number 2
R7:
dis current-configuration
[V200R003C00]
snmp-agent local-engineid 800007DB03000000000000
snmp-agent
clock timezone China-Standard-Time minus 08:00:00
portal local-server load flash:/portalpage.zip
drop illegal-mac alarm
wlan ac-global carrier id other ac id 0
set cpu-usage threshold 80 restore 75
interface GigabitEthernet0/0/0
ip address 17.1.1.7 255.255.255.0
interface GigabitEthernet0/0/1
interface GigabitEthernet0/0/2
interface NULL0
interface LoopBack0
ip address 7.7.7.7 255.255.255.255
bgp 1
peer 17.1.1.1 as-number 100
ipv4-family unicast
undo synchronization
network 7.7.7.7 255.255.255.255
peer 17.1.1.1 enable
R8:
dis current-configuration
[V200R003C00]
snmp-agent local-engineid 800007DB03000000000000
snmp-agent
clock timezone China-Standard-Time minus 08:00:00
portal local-server load flash:/portalpage.zip
drop illegal-mac alarm
wlan ac-global carrier id other ac id 0
set cpu-usage threshold 80 restore 75
interface GigabitEthernet0/0/0
ip address 68.1.1.8 255.255.255.0
interface GigabitEthernet0/0/1
interface GigabitEthernet0/0/2
interface NULL0
interface LoopBack0
ip address 8.8.8.8 255.255.255.255
bgp 2
peer 68.1.1.6 as-number 200
ipv4-family unicast
undo synchronization
network 8.8.8.8 255.255.255.255
peer 68.1.1.6 enable
最终实现ping -a 7.7.7.7 8.8.8.8 通