本帖最后由 easthomeRT 于 2015-4-10 10:33 编辑
1.网络拓扑: 说明:AR1-AR2-AR3 之间运行MPLS标签交换,ISP运营商路由器 AR4 AR5 为CE设备,客户端路由器 2.各路由器配置: 1)AR1配置:
sysname R1
#
undo info-center enable
#
router id 1.1.1.1
#
ip vpn-instance r1 #配置VPN实例
ipv4-family
route-distinguisher 100:1 #配置RD用于区分不同的VPN
vpn-target 100:1 export-extcommunity
vpn-target 100:1 100:3 import-extcommunity
#
mpls lsr-id 1.1.1.1 #配置 MPLS LSR-ID路由器ID
mpls
#
mpls ldp
#
interface Ethernet0/0/0
ip binding vpn-instance r1
ip address 14.1.1.1 255.255.255.0
#
interface Serial0/0/0
link-protocol ppp
ip address 10.0.12.1 255.255.255.0
mpls
mpls ldp
#
interface LoopBack0
ip address 1.1.1.1 255.255.255.255
#
bgp 100
undo default ipv4-unicast
peer 3.3.3.3 as-number 100
peer 3.3.3.3 connect-interface LoopBack0
#
ipv4-family unicast
undo synchronization
peer 3.3.3.3 enable
#
ipv4-family vpnv4
policy vpn-target
peer 3.3.3.3 enable
#
ipv4-family vpn-instance r1
import-route ospf 1
#
ospf 1 router-id 14.1.1.1 vpn-instance r1
import-route bgp tag 100
area 0.0.0.0
network 14.1.1.0 0.0.0.255
#
ospf 100 router-id 1.1.1.1
area 0.0.0.0
network 10.0.12.0 0.0.0.255
network 1.1.1.1 0.0.0.0
#
2)AR2配置:
sysname R2
#
undo info-center enable
#
router id 2.2.2.2
#
mpls lsr-id 2.2.2.2
mpls
#
mpls ldp
#
interface Serial0/0/0
link-protocol ppp
ip address 10.0.12.2 255.255.255.0
mpls
mpls ldp
#
interface Serial0/0/1
link-protocol ppp
ip address 10.0.23.2 255.255.255.0
mpls
mpls ldp
interface LoopBack1
ip address 2.2.2.2 255.255.255.255
#
ospf 100 router-id 2.2.2.2
area 0.0.0.0
network 10.0.12.0 0.0.0.255
network 10.0.23.0 0.0.0.255
network 2.2.2.2 0.0.0.0
# 3)AR3配置:
sysname R3
#
undo info-center enable
#
router id 3.3.3.3
#
ip vpn-instance r3
ipv4-family
route-distinguisher 100:3
vpn-target 100:1 export-extcommunity
vpn-target 100:1 100:3 import-extcommunity
#
mpls lsr-id 3.3.3.3
mpls
#
mpls ldp
#
interface Ethernet0/0/0
ip binding vpn-instance r3
ip address 35.1.1.3 255.255.255.0
#
interface Serial0/0/1
link-protocol ppp
ip address 10.0.23.3 255.255.255.0
mpls
mpls ldp
#
interface LoopBack1
ip address 3.3.3.3 255.255.255.255
#
bgp 100
undo default ipv4-unicast
peer 1.1.1.1 as-number 100
peer 1.1.1.1 connect-interface LoopBack1
#
ipv4-family unicast
undo synchronization
peer 1.1.1.1 enable
#
ipv4-family vpnv4
policy vpn-target
peer 1.1.1.1 enable
#
ipv4-family vpn-instance r3
import-route ospf 2
#
ospf 2 router-id 35.1.1.3 vpn-instance r3
import-route bgp tag 100
area 0.0.0.0
network 35.1.1.0 0.0.0.255
#
ospf 100 router-id 3.3.3.3
area 0.0.0.0
network 10.0.23.0 0.0.0.255
network 3.3.3.3 0.0.0.0
# 4)AR4配置:
sysname r4
#
undo info-center enable
#
interface Ethernet0/0/0
ip address 14.1.1.4 255.255.255.0
#
interface LoopBack0
ip address 4.4.4.4 255.255.255.255
#
ospf 1 router-id 14.1.1.4
area 0.0.0.0
network 14.1.1.0 0.0.0.255
network 4.4.4.4 0.0.0.0 5)AR5配置:
sysname r5
#
undo info-center enable
#
interface Ethernet0/0/0
ip address 35.1.1.5 255.255.255.0
interface LoopBack0
ip address 5.5.5.5 255.255.255.255
#
ospf 2 router-id 35.1.1.5
area 0.0.0.0
network 35.1.1.0 0.0.0.255
network 5.5.5.5 0.0.0.0
#
user-interface con 0
user-interface vty 0 4
user-interface vty 16 20
#
3.验证:两个VPN站点运行OSPF路由协议 网络流量跟踪正常 此文出自东方瑞通邓宏伟老师,转载需注明出处。
|