Lab1 跨域MPLS-虚拟专网 Option A配置详解

实验拓扑:

在这里插入图片描述

实验需求:

需要R5与R7,私网通信,R6与R8私网通信。中间穿越互联网多个AS域。解决路由黑洞问题。

地址预配,不再描述。例如R5,g0/0/0:192.168.15.5/24;lo0:192.168.5.5/32

实验结果:

在这里插入图片描述
在这里插入图片描述

实验配置:

所有设备配置如下,每一步就不写了,有疑问可以留言:

  1. 配置各设备IP地址,R1、R4与客户互联接口,划分VRF后再配置IP地址。R2、R3之间配置子接口。
  2. 运行IGP协议:R1、R2之间运行ISIS,R3、R4之间运行ISIS。使其ISP公网互通。
  3. 运行BGP协议:R1、R2之间使用Looback0建立v.p.n.v4邻居。
  4. 运行MPLS协议:R1、R2、R3、R4,启用LDP,自动分发标签。
  5. 配置MPLS-虚拟专网:客户R5与R7与ISP之间运行BGP,创建VRF,配置RD、RT值。客户R6与R8与ISP之间运行OSPF。
  6. 配置其他需要配置,使其R5与R7,R6与R8实现私网通信。

R1

<R1>dis cu
[V200R003C00]
#
 sysname R1
#
 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 5
 ipv4-family
  route-distinguisher 5:5
  vpn-target 51:52 export-extcommunity
  vpn-target 52:51 import-extcommunity
#
ip vpn-instance 6
 ipv4-family
  route-distinguisher 6:6
  vpn-target 61:62 export-extcommunity
  vpn-target 62:61 import-extcommunity
#
mpls lsr-id 1.1.1.1
mpls
#
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
#
isis 1
 is-level level-2
 network-entity 49.0012.0000.0000.0001.00
 is-name R1
#
firewall zone Local
 priority 15
#
interface GigabitEthernet0/0/0
 ip address 12.1.1.1 255.255.255.0 
 isis enable 1
 mpls
 mpls ldp
#
interface GigabitEthernet0/0/1
 ip binding vpn-instance 5
 ip address 192.168.15.1 255.255.255.0 
#
interface GigabitEthernet0/0/2
 ip binding vpn-instance 6
 ip address 192.168.16.1 255.255.255.0 
#
interface NULL0
#
interface LoopBack0
 ip address 1.1.1.1 255.255.255.255 
 isis enable 1
#
bgp 12
 undo default ipv4-unicast
 peer 2.2.2.2 as-number 12 
 peer 2.2.2.2 connect-interface LoopBack0
 #
 ipv4-family unicast
  undo synchronization
  undo peer 2.2.2.2 enable
 # 
 ipv4-family vpnv4
  policy vpn-target
  peer 2.2.2.2 enable
 #
 ipv4-family vpn-instance 5 
  peer 192.168.15.5 as-number 5 
 #
 ipv4-family vpn-instance 6 
  import-route ospf 1
#
ospf 1 router-id 1.1.1.1 vpn-instance 6
 import-route bgp
 area 0.0.0.0 
  network 192.168.16.1 0.0.0.0 
#
user-interface con 0
 authentication-mode password
user-interface vty 0 4
user-interface vty 16 20
#
wlan ac
#
return

R2

<R2>dis cu
[V200R003C00]
#
 sysname R2
#
 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 5
 ipv4-family
  route-distinguisher 5:5
  vpn-target 52:51 export-extcommunity
  vpn-target 51:52 import-extcommunity
#
ip vpn-instance 6
 ipv4-family
  route-distinguisher 6:6
  vpn-target 62:61 export-extcommunity
  vpn-target 61:62 import-extcommunity
#
mpls lsr-id 2.2.2.2
mpls
#
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
#
isis 1
 is-level level-2
 network-entity 49.0012.0000.0000.0002.00
 is-name R2
#
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
#
interface GigabitEthernet0/0/1.57
 dot1q termination vid 57
 ip binding vpn-instance 5
 ip address 192.168.23.2 255.255.255.0 
 arp broadcast enable
#
interface GigabitEthernet0/0/1.68
 dot1q termination vid 68
 ip binding vpn-instance 6
 ip address 192.168.23.2 255.255.255.0 
 arp broadcast enable
#
interface GigabitEthernet0/0/2
#
interface NULL0
#
interface LoopBack0
 ip address 2.2.2.2 255.255.255.255 
 isis enable 1
#
bgp 12
 undo default ipv4-unicast
 peer 1.1.1.1 as-number 12 
 peer 1.1.1.1 connect-interface LoopBack0
 #
 ipv4-family unicast
  undo synchronization
  undo peer 1.1.1.1 enable
 # 
 ipv4-family vpnv4
  policy vpn-target
  peer 1.1.1.1 enable
 #
 ipv4-family vpn-instance 5 
  peer 192.168.23.3 as-number 34 
 #
 ipv4-family vpn-instance 6 
  peer 192.168.23.3 as-number 34 
#
user-interface con 0
 authentication-mode password
user-interface vty 0 4
user-interface vty 16 20
#
wlan ac
#
return

R3

<R3>dis cu
[V200R003C00]
#
 sysname R3
#
 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 7
 ipv4-family
  route-distinguisher 7:7
  vpn-target 73:74 export-extcommunity
  vpn-target 74:73 import-extcommunity
#
ip vpn-instance 8
 ipv4-family                              
  route-distinguisher 8:8
  vpn-target 83:84 export-extcommunity
  vpn-target 84:83 import-extcommunity
#
mpls lsr-id 3.3.3.3
mpls
#
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
#
isis 1
 is-level level-2
 network-entity 49.0034.0000.0000.0003.00
 is-name R3
#                                         
firewall zone Local
 priority 15
#
interface GigabitEthernet0/0/0
#
interface GigabitEthernet0/0/0.57
 dot1q termination vid 57
 ip binding vpn-instance 7
 ip address 192.168.23.3 255.255.255.0 
 arp broadcast enable
#
interface GigabitEthernet0/0/0.68
 dot1q termination vid 68
 ip binding vpn-instance 8
 ip address 192.168.23.3 255.255.255.0 
 arp broadcast enable
#
interface GigabitEthernet0/0/1
 ip address 34.1.1.3 255.255.255.0 
 isis enable 1
 mpls
 mpls ldp
#
interface GigabitEthernet0/0/2            
#
interface NULL0
#
interface LoopBack0
 ip address 3.3.3.3 255.255.255.255 
 isis enable 1
#
bgp 34
 undo default ipv4-unicast
 peer 4.4.4.4 as-number 34 
 peer 4.4.4.4 connect-interface LoopBack0
 #
 ipv4-family unicast
  undo synchronization
  undo peer 4.4.4.4 enable
 # 
 ipv4-family vpnv4
  policy vpn-target
  peer 4.4.4.4 enable
 #
 ipv4-family vpn-instance 7 
  peer 192.168.23.2 as-number 12 
 #
 ipv4-family vpn-instance 8               
  peer 192.168.23.2 as-number 12 
#
user-interface con 0
 authentication-mode password
user-interface vty 0 4
user-interface vty 16 20
#
wlan ac
#
return

R4

<R4>dis cu
[V200R003C00]
#
 sysname R4
#
 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 7
 ipv4-family
  route-distinguisher 7:7
  vpn-target 74:73 export-extcommunity
  vpn-target 73:74 import-extcommunity
#
ip vpn-instance 8
 ipv4-family                              
  route-distinguisher 8:8
  vpn-target 84:83 export-extcommunity
  vpn-target 83:84 import-extcommunity
#
mpls lsr-id 4.4.4.4
mpls
#
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
#
isis 1
 is-level level-2
 network-entity 49.0034.0000.0000.0004.00
 is-name R4
#                                         
firewall zone Local
 priority 15
#
interface GigabitEthernet0/0/0
 ip address 34.1.1.4 255.255.255.0 
 isis enable 1
 mpls
 mpls ldp
#
interface GigabitEthernet0/0/1
 ip binding vpn-instance 7
 ip address 192.168.47.4 255.255.255.0 
#
interface GigabitEthernet0/0/2
 ip binding vpn-instance 8
 ip address 192.168.48.4 255.255.255.0 
#
interface NULL0
#
interface LoopBack0
 ip address 4.4.4.4 255.255.255.255 
 isis enable 1
#
bgp 34                                    
 undo default ipv4-unicast
 peer 3.3.3.3 as-number 34 
 peer 3.3.3.3 connect-interface LoopBack0
 #
 ipv4-family unicast
  undo synchronization
  undo peer 3.3.3.3 enable
 # 
 ipv4-family vpnv4
  policy vpn-target
  peer 3.3.3.3 enable
 #
 ipv4-family vpn-instance 7 
  peer 192.168.47.7 as-number 7 
 #
 ipv4-family vpn-instance 8 
  import-route ospf 1
#
ospf 1 router-id 4.4.4.4 vpn-instance 8
 import-route bgp
 area 0.0.0.0 
  network 192.168.48.4 0.0.0.0 
#
user-interface con 0                      
 authentication-mode password
user-interface vty 0 4
user-interface vty 16 20
#
wlan ac
#
return

R5

[R5]dis cu
[V200R003C00]
#
 sysname R5
#
 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
#
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 192.168.15.5 255.255.255.0 
#
interface GigabitEthernet0/0/1
#
interface GigabitEthernet0/0/2
#
interface NULL0
#
interface LoopBack0
 ip address 192.168.5.5 255.255.255.255 
#
bgp 5
 router-id 5.5.5.5
 peer 192.168.15.1 as-number 12 
 #
 ipv4-family unicast
  undo synchronization
  network 192.168.5.5 255.255.255.255 
  network 192.168.15.0                    
  peer 192.168.15.1 enable
  peer 192.168.15.1 allow-as-loop
#
user-interface con 0
 authentication-mode password
user-interface vty 0 4
user-interface vty 16 20
#
wlan ac
#
return

R6


[R6]dis cu
[V200R003C00]
#
 sysname R6
#
 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
#
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 192.168.16.6 255.255.255.0 
#
interface GigabitEthernet0/0/1
#
interface GigabitEthernet0/0/2
#
interface NULL0
#
interface LoopBack0
 ip address 192.168.6.6 255.255.255.255 
#
ospf 1 router-id 6.6.6.6 
 area 0.0.0.0 
  network 192.168.6.6 0.0.0.0 
  network 192.168.16.6 0.0.0.0 
#
user-interface con 0
 authentication-mode password
user-interface vty 0 4                    
user-interface vty 16 20
#
wlan ac
#
return

R7

<R7>dis cu
[V200R003C00]
#
 sysname R7
#
 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
#
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 192.168.47.7 255.255.255.0 
#
interface GigabitEthernet0/0/1
#
interface GigabitEthernet0/0/2
#
interface NULL0
#
interface LoopBack0
 ip address 192.168.7.7 255.255.255.255 
#
bgp 7
 router-id 7.7.7.7
 peer 192.168.47.4 as-number 34 
 #
 ipv4-family unicast
  undo synchronization
  network 192.168.7.7 255.255.255.255 
  network 192.168.47.0                    
  peer 192.168.47.4 enable
  peer 192.168.47.4 allow-as-loop
#
user-interface con 0
 authentication-mode password
user-interface vty 0 4
user-interface vty 16 20
#
wlan ac
#
return

R8

<R8>DIS CU
[V200R003C00]
#
 sysname R8
#
 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
#
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 192.168.48.8 255.255.255.0 
#
interface GigabitEthernet0/0/1
#
interface GigabitEthernet0/0/2
#
interface NULL0
#
interface LoopBack0
 ip address 192.168.8.8 255.255.255.255 
#
ospf 1 router-id 8.8.8.8 
 area 0.0.0.0 
  network 192.168.8.8 0.0.0.0 
  network 192.168.48.8 0.0.0.0 
#
user-interface con 0
 authentication-mode password
user-interface vty 0 4                    
user-interface vty 16 20
#
wlan ac
#
return

完结!!

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值