实验要求
1.如图连接拓扑,合理规划IP地址,R1、R5、R6、R7各种创建一个环回,IP地址分别为192.168.1.0 、192.168.2.0、192.168.3.0、192.168.4.0 2.AS 100内使用IGP协议为OSPF ,如图运行动态路由协议 3.要求R1-R5之间启用MPLS VPN ; R6-R7之间启用MPLS VPN; 4.将两条VPN 进行合并 5.R6-R7之间使用OSPF协议,要求R6-R7之间的私有IP地址通信优先使用MPLS
实验拓扑搭建
相关配置
AR1
interface GigabitEthernet0/0/0 ip address 12.1.1.1 255.255.255.0
interface GigabitEthernet0/0/1
interface GigabitEthernet0/0/2
interface NULL0
interface LoopBack0 ip address 192.168.1.1 255.255.255.255
interface LoopBack1
rip 100 undo summary version 2 network 12.0.0.0 network 192.168.1.0
AR2
ip vpn-instance a ipv4-family route-distinguisher 100:1 vpn-target 100:1 1:1 export-extcommunity vpn-target 100:1 1:1 import-extcommunity
ip vpn-instance b ipv4-family route-distinguisher 100:2 vpn-target 100:2 1:1 export-extcommunity vpn-target 100:2 1:1 import-extcommunity
mpls lsr-id 2.2.2.2 mpls lsp-trigger all
mpls ldp
interface GigabitEthernet0/0/0 ip binding vpn-instance b ip address 12.1.1.2 255.255.255.0
interface GigabitEthernet0/0/1 ip binding vpn-instance a ip address 26.1.1.2 255.255.255.0
interface GigabitEthernet0/0/2 ip address 23.1.1.1 255.255.255.0 mpls mpls ldp
interface NULL0
interface LoopBack0 ip address 2.2.2.2 255.255.255.255 ospf network-type broadcast
interface LoopBack1 ip binding vpn-instance a ip address 10.1.1.1 255.255.255.255
bgp 100 router-id 2.2.2.2 peer 4.4.4.4 as-number 100 peer 4.4.4.4 connect-interface LoopBack0
ipv4-family unicast undo synchronization peer 4.4.4.4 enable peer 4.4.4.4 next-hop-local
ipv4-family vpnv4 policy vpn-target peer 4.4.4.4 enable peer 4.4.4.4 advertise-community
ipv4-family vpn-instance a network 10.1.1.1 255.255.255.255 import-route ospf 200
ipv4-family vpn-instance b import-route rip 100
ospf 1
ospf 100 area 0.0.0.0 network 2.2.2.2 0.0.0.0 network 23.1.1.1 0.0.0.0
ospf 200 router-id 92.2.2.2 vpn-instance a import-route bgp area 0.0.0.0 network 26.1.1.2 0.0.0.0 sham-link 10.1.1.1 10.1.1.2
rip 100 vpn-instance b version 2 network 12.0.0.0 import-route bgp
route recursive-lookup tunnel
AR3
interface GigabitEthernet0/0/0 ip address 34.1.1.1 255.255.255.0 mpls mpls ldp
interface GigabitEthernet0/0/1
interface GigabitEthernet0/0/2 ip address 23.1.1.2 255.255.255.0 mpls mpls ldp
interface NULL0
interface LoopBack0 ip address 3.3.3.3 255.255.255.255 ospf network-type broadcast
ospf 1
ospf 100 area 0.0.0.0 network 3.3.3.3 0.0.0.0 network 23.1.1.2 0.0.0.0 network 34.1.1.1 0.0.0.0
AR4
ip vpn-instance a ipv4-family route-distinguisher 100:1 vpn-target 100:1 1:1 export-extcommunity vpn-target 100:1 1:1 import-extcommunity
ip vpn-instance b ipv4-family route-distinguisher 100:2 vpn-target 100:2 1:1 export-extcommunity vpn-target 100:2 1:1 import-extcommunity
mpls lsr-id 4.4.4.4 mpls lsp-trigger all
mpls ldp
aaa authentication-scheme default authorization-scheme default accounting-scheme default domain default domain default_admin local-user admin password cipher %
%
K8m.Nt84DZ}e#<0`8bmE3Uw}%
%
local-user admin service-type http
firewall zone Local priority 15
interface GigabitEthernet0/0/0 ip address 34.1.1.2 255.255.255.0 mpls mpls ldp
interface GigabitEthernet0/0/1 ip binding vpn-instance b ip address 45.1.1.2 255.255.255.0
interface GigabitEthernet0/0/2 ip binding vpn-instance a ip address 47.1.1.2 255.255.255.0
interface NULL0
interface LoopBack0 ip address 4.4.4.4 255.255.255.255 ospf network-type broadcast
interface LoopBack1 ip binding vpn-instance a ip address 10.1.1.2 255.255.255.255
bgp 100 router-id 4.4.4.4 peer 2.2.2.2 as-number 100 peer 2.2.2.2 connect-interface LoopBack0 peer 45.1.1.1 as-number 5 peer 47.1.1.1 as-number 7
ipv4-family unicast undo synchronization peer 2.2.2.2 enable peer 2.2.2.2 next-hop-local peer 45.1.1.1 enable peer 47.1.1.1 enable
ipv4-family vpnv4 policy vpn-target peer 2.2.2.2 enable
ipv4-family vpn-instance a network 10.1.1.2 255.255.255.255 import-route ospf 200
ipv4-family vpn-instance b import-route rip 100
ospf 100 area 0.0.0.0 network 4.4.4.4 0.0.0.0 network 34.1.1.2 0.0.0.0
ospf 200 router-id 94.4.4.4 vpn-instance a import-route bgp area 0.0.0.0 network 47.1.1.2 0.0.0.0 sham-link 10.1.1.2 10.1.1.1
rip 100 vpn-instance b version 2 network 45.0.0.0 import-route bgp
route recursive-lookup tunnel
AR5
interface GigabitEthernet0/0/0
interface GigabitEthernet0/0/1 ip address 45.1.1.1 255.255.255.0
interface GigabitEthernet0/0/2
interface NULL0
interface LoopBack0 ip address 192.168.2.1 255.255.255.255
rip 100 undo summary version 2 network 45.0.0.0 network 192.168.2.0
AR6
interface GigabitEthernet0/0/0 ip address 67.1.1.1 255.255.255.0 ospf cost 5
interface GigabitEthernet0/0/1 ip address 26.1.1.1 255.255.255.0
interface GigabitEthernet0/0/2
interface NULL0
interface LoopBack0 ip address 192.168.3.1 255.255.255.255
ospf 1 import-route ospf 200 area 0.0.0.0 network 67.1.1.1 0.0.0.0
ospf 200 area 0.0.0.0 network 26.1.1.1 0.0.0.0 network 192.168.3.1 0.0.0.0
AR7
interface GigabitEthernet0/0/0 ip address 67.1.1.2 255.255.255.0 ospf cost 5
interface GigabitEthernet0/0/1
interface GigabitEthernet0/0/2 ip address 47.1.1.1 255.255.255.0
interface NULL0
interface LoopBack0 ip address 192.168.4.1 255.255.255.255
ospf 1 import-route ospf 200 area 0.0.0.0 network 67.1.1.2 0.0.0.0
ospf 200 area 0.0.0.0 network 47.1.1.1 0.0.0.0 network 192.168.4.1 0.0.0.0
测试
AS 100内使用IGP协议为OSPF ,R2/R3/R4邻居关系 要求R1-R5之间启用MPLS VPN ; R6-R7之间启用MPLS VPN;
将两条VPN 进行合并R1/R5/R6/R7之间可以相互访问
R6-R7之间使用OSPF协议,要求R6-R7之间的私有IP地址通信优先使用MPLS
|