VRF(Virtual Routing Forwarding,虚拟路由转发)技术通过在一台三层转发设备上创建多张路由表实现数据或业务的隔离,常用于MPLS VPN、防火墙等一些需要实现隔离的应用场景。
流程
1)配置IGP
2)配置BGP
3)配置MPLS LDP
4)创建实例ip vpn-instance VPNA
5)接口应用实例
6)配置协议路由
7)配置VPNV4对等体
配置
PE1
<PE1>display current-configuration
[V200R003C00]
#
sysname PE1
#
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 1:3
vpn-target 1:3 export-extcommunity
vpn-target 1:3 import-extcommunity
#
ip vpn-instance VPNB
ipv4-family
route-distinguisher 2:4
vpn-target 2:4 export-extcommunity
vpn-target 2:4 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 100
is-level level-2
cost-style wide
network-entity 49.0001.0010.0100.1001.00
#
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 binding vpn-instance VPNB
ip address 40.1.1.2 255.255.255.0
#
interface GigabitEthernet0/0/2
ip address 10.1.1.1 255.255.255.0
isis enable 100
mpls
mpls ldp
#
interface NULL0
#
interface LoopBack0
ip address 1.1.1.1 255.255.255.255
isis enable 100
#
bgp 200
router-id 1.1.1.1
peer 3.3.3.3 as-number 200
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 100
#
ipv4-family vpn-instance VPNB
import-route ospf 200
#
ospf 100 vpn-instance VPNA
import-route bgp
area 0.0.0.0
network 30.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
idle-timeout 0 0
user-interface vty 0 4
user-interface vty 16 20
#
wlan ac
#
return
P
<P>display current-configuration
[V200R003C00]
#
sysname P
#
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
#
isis 100
is-level level-2
cost-style wide
network-entity 49.0001.0020.0200.2002.00
#
firewall zone Local
priority 15
#
interface GigabitEthernet0/0/0
ip address 10.1.1.2 255.255.255.0
isis enable 100
mpls
mpls ldp
#
interface GigabitEthernet0/0/1
ip address 20.1.1.1 255.255.255.0
isis enable 100
mpls
mpls ldp
#
interface GigabitEthernet0/0/2
#
interface NULL0
#
interface LoopBack0
ip address 2.2.2.2 255.255.255.255
isis enable 100
#
user-interface con 0
authentication-mode password
idle-timeout 0 0
user-interface vty 0 4
user-interface vty 16 20
#
wlan ac
#
return
PE2
<PE2>display current-configuration
[V200R003C00]
#
sysname PE2
#
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 3:1
vpn-target 1:3 export-extcommunity
vpn-target 1:3 import-extcommunity
#
ip vpn-instance VPNB
ipv4-family
route-distinguisher 4:2
vpn-target 2:4 export-extcommunity
vpn-target 2:4 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 100
is-level level-2
cost-style wide
network-entity 49.0001.0030.0300.3003.00
#
firewall zone Local
priority 15
#
interface GigabitEthernet0/0/0
ip address 20.1.1.2 255.255.255.0
isis enable 100
mpls
mpls ldp
#
interface GigabitEthernet0/0/1
ip binding vpn-instance VPNA
ip address 50.1.1.2 255.255.255.0
#
interface GigabitEthernet0/0/2
ip binding vpn-instance VPNB
ip address 60.1.1.2 255.255.255.0
#
interface NULL0
#
interface LoopBack0
ip address 3.3.3.3 255.255.255.255
isis enable 100
#
bgp 200
router-id 3.3.3.3
peer 1.1.1.1 as-number 200
peer 1.1.1.1 connect-interface LoopBack0
#
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 VPNA
import-route ospf 100
#
ipv4-family vpn-instance VPNB
import-route ospf 200
#
ospf 100 vpn-instance VPNA
import-route bgp
area 0.0.0.0
network 50.1.1.0 0.0.0.255
#
ospf 200 vpn-instance VPNB
import-route bgp
area 0.0.0.0
network 60.1.1.0 0.0.0.255
#
user-interface con 0
authentication-mode password
idle-timeout 0 0
user-interface vty 0 4
user-interface vty 16 20
#
wlan ac
#
return