目录
1.拓扑图
2.要求
3.主要配置
4.测试
1.拓扑图
2.要求
实现全网可达
3.主要配置
isp区域已配置ospf,bgp
然后配置mpls(r2)
r2]mpls lsr-id 2.2.2.2
[r2]mpls
Info: Mpls starting, please wait... OK!
[r2-mpls]mpls ld
[r2-mpls-ldp]q
[r2]int g0/0/1
[r2-GigabitEthernet0/0/1]mpls
[r2-GigabitEthernet0/0/1]mpls ldp
[r2]int g0/0/2
[r2-GigabitEthernet0/0/2]mpls
[r2-GigabitEthernet0/0/2]mpls ldp
[r2]ip vpn-instance 1
[r2-vpn-instance-1]route-distinguisher 1:1
[r2-vpn-instance-1-af-ipv4]vpn-target 5:5 6:6 import-extcommunity
IVT Assignment result:
Info: VPN-Target assignment is successful.
[r2-vpn-instance-1-af-ipv4]vpn-target 1:1 export-extcommunity[r2-GigabitEthernet0/0/0]undo ip add
[r2-GigabitEthernet0/0/0]ip binding vpn-instance 1 //这里需注意需要先把ip地址删除[r2-GigabitEthernet0/0/0]ip add 12.1.1.2 24 //再配上ip
[r2]ip route-static vpn-instance 1 1.1.1.1 32 12.1.1.1
[r2]bgp 1
[r2-bgp]ipv4-family vpn-instance 1
[r2-bgp-1]import-route static
r3,r4 配置基本相同
[r3]mpls lsr-id 3.3.3.3
[r3]mpls
Info: Mpls starting, please wait... OK!
[r3-mpls]mpls ld
[r3-mpls-ldp]q
[r3]int g0/0/0
[r3-GigabitEthernet0/0/0]mpls
[r3-GigabitEthernet0/0/0]mpls ldp[r3]int g0/0/1
[r3-GigabitEthernet0/0/1]mpls
[r3-GigabitEthernet0/0/1]mpls ldp[r3]int g0/0/2
[r3-GigabitEthernet0/0/2]mpls
[r3-GigabitEthernet0/0/2]mpls ldp
[r3-GigabitEthernet0/0/2]q
r5配置
[r5]mpls lsr-id 5.5.5.5
[r5]mpls
Info: Mpls starting, please wait... OK!
[r5-mpls]mpls ldp
[r5-mpls-ldp]q
[r5]int g0/0/0
[r5-GigabitEthernet0/0/0]mpls
[r5-GigabitEthernet0/0/0]mpls ldp
[r5]int g0/0/1
[r5-GigabitEthernet0/0/1]mpls
[r5-GigabitEthernet0/0/1]mpls ldp
[r5]ip vpn
[r5]ip vpn-instance 2
[r5-vpn-instance-2]route-distinguisher 5:5
[r5-vpn-instance-2-af-ipv4]vpn-target 1:1 6:6 import-extcommunity
IVT Assignment result:
Info: VPN-Target assignment is successful.
[r5-vpn-instance-2-af-ipv4]vpn-target 5:5 export-extcommunity
EVT Assignment result:
Info: VPN-Target assignment is successful.
[r5-vpn-instance-2-af-ipv4]q
[r5-vpn-instance-2]q
[r5]int g0/0/2
[r5-GigabitEthernet0/0/2]undo ip add
[r5-GigabitEthernet0/0/2]ip binding vpn-instance 2
[r5-GigabitEthernet0/0/2]ip add 57.1.1.1 24[r5]rip 1 vpn-instance 2
[r5-rip-1]version 2
[r5-rip-1]network 57.0.0.0
[r5-rip-1]import-router bgp
[r5-rip-1]q
[r5]bgp 1
[r5-bgp]ipv4-family vpn-instance 2
[r5-bgp-2]import-route rip 1
r6配置
[r6]ip vpn
[r6]ip vpn-instance 3
[r6-vpn-instance-3]rou
[r6-vpn-instance-3]route-distinguisher 6:6
[r6-vpn-instance-3-af-ipv4]vpn-target 1:1 5:5 import-extcommunity
IVT Assignment result:
Info: VPN-Target assignment is successful.
[r6-vpn-instance-3-af-ipv4]vpn-target 6:6 export-extcommunity
EVT Assignment result:
Info: VPN-Target assignment is successful.
[r6-vpn-instance-3-af-ipv4]q
[r6-vpn-instance-3]q
[r6]int g0/0/2[r6-GigabitEthernet0/0/2]ip add 68.1.1.1 24
[r6]ospf 2 vpn
[r6]ospf 2 vpn-instance 3
[r6-ospf-2]area 0
[r6-ospf-2-area-0.0.0.0]network 68.1.1.1 0.0.0.0[r6]bgp 1
[r6-bgp]ipv4-family vpn-instance 3
[r6-bgp-3]import-route ospf 2
4.测试
实现全网可达