1、测试实验拓扑图

VPNV4实验测试_Standard

2、实验目的

测试实例名称不一致,是否能够通信(VPNA-VPNB)

3、核心知识

VPNV4是隧道,VPNA、VPNB通过隧道传输,唯一标识RD(本地有效)、RT(全局有效)

4、配置

R:

<r2>display current-configuration  

[V200R003C00]

#

sysname r2

#

snmp-agent local-engineid 800007DB03000000000000

snmp-agent  

#

clock timezone China-Standard-Time minus 08:00:00

#

portal local-server load portalpage.zip

#

drop illegal-mac alarm

#

set cpu-usage threshold 80 restore 75

#

ip vpn-instance VPNA

ipv4-family

 route-distinguisher 2:1

 vpn-target 2:3 export-extcommunity

 vpn-target 2:3 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

#

firewall zone Local

priority 15

#

interface GigabitEthernet0/0/0

ip binding vpn-instance VPNA

ip address 30.1.1.2 255.255.255.0  

#

interface GigabitEthernet0/0/1

ip address 10.1.1.1 255.255.255.0  

mpls

mpls ldp

#

interface GigabitEthernet0/0/2

#

interface NULL0

#

interface LoopBack0

ip address 1.1.1.1 255.255.255.255  

#

bgp 100

router-id 1.1.1.1

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 VPNA  

 import-route ospf 200

#

ospf 100 router-id 1.1.1.1  

area 0.0.0.0  

 network 1.1.1.1 0.0.0.0  

 network 10.1.1.0 0.0.0.255  

#

ospf 200 vpn-instance VPNA

import-route bgp

area 0.0.0.0  

 network 30.1.1.0 0.0.0.255  

#

user-interface con 0

authentication-mode password

user-interface vty 0 4

user-interface vty 16 20

#

wlan ac

#

return

<r2>

R3:

<r3>display current-configuration  

[V200R003C00]

#

sysname r3

#

snmp-agent local-engineid 800007DB03000000000000

snmp-agent  

#

clock timezone China-Standard-Time minus 08:00:00

#

portal local-server load portalpage.zip

#

drop illegal-mac alarm

#

set cpu-usage threshold 80 restore 75

#

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

#

firewall zone Local

priority 15

#

interface GigabitEthernet0/0/0

ip address 10.1.1.2 255.255.255.0  

mpls

mpls ldp

#

interface GigabitEthernet0/0/1

ip address 20.1.1.1 255.255.255.0  

mpls

mpls ldp

#

interface GigabitEthernet0/0/2

#

interface NULL0

#

interface LoopBack0

ip address 2.2.2.2 255.255.255.255  

#

ospf 100 router-id 2.2.2.2  

area 0.0.0.0  

 network 2.2.2.2 0.0.0.0  

 network 10.1.1.0 0.0.0.255  

 network 20.1.1.0 0.0.0.255  

#

user-interface con 0

authentication-mode password

user-interface vty 0 4

user-interface vty 16 20

#

wlan ac

#

return

<r3>

R4:

<r4>display current-configuration  

[V200R003C00]

#

sysname r4

#

snmp-agent local-engineid 800007DB03000000000000

snmp-agent  

#

clock timezone China-Standard-Time minus 08:00:00

#

portal local-server load portalpage.zip

#

drop illegal-mac alarm

#

set cpu-usage threshold 80 restore 75

#

ip vpn-instance VPNB

ipv4-family

 route-distinguisher 5:4

 vpn-target 2:3 export-extcommunity

 vpn-target 2:3 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

#

firewall zone Local

priority 15

#

interface GigabitEthernet0/0/0

ip address 20.1.1.2 255.255.255.0  

mpls

mpls ldp

#

interface GigabitEthernet0/0/1

ip binding vpn-instance VPNB

ip address 40.1.1.2 255.255.255.0  

#

interface GigabitEthernet0/0/2

#

interface NULL0

#

interface LoopBack0

ip address 3.3.3.3 255.255.255.255  

#

bgp 100

router-id 3.3.3.3

peer 1.1.1.1 as-number 100  

peer 1.1.1.1 connect-interface LoopBack0

#

ipv4-family unicast

 undo synchronization

 peer 1.1.1.1 enable

 peer 1.1.1.1 reflect-client

#  

ipv4-family vpnv4

 policy vpn-target

 peer 1.1.1.1 enable

#

ipv4-family vpn-instance VPNB  

 import-route ospf 200

#

ospf 100 router-id 3.3.3.3  

area 0.0.0.0  

 network 3.3.3.3 0.0.0.0  

 network 20.1.1.0 0.0.0.255  

#

ospf 200 vpn-instance VPNB

import-route bgp

area 0.0.0.0  

 network 40.1.1.0 0.0.0.255  

#

user-interface con 0

authentication-mode password

user-interface vty 0 4

user-interface vty 16 20

#

wlan ac

#

return

<r4>

5、效果

VPNV4实验测试_Standard_02