Programmable Internetworking & Communication Operating System Docs ... Click Spaces -> Space Directory to see docs for all releases ...
Page tree
Skip to end of metadata
Go to start of metadata


Networking Requirements

Figure 1. VRF Configuration Example

As shown in Figure 1, users of Site1 and Site2 use overlapping IP addresses when accessing the internet from an interface of CE. Implement the VRF function on the CE to segregate the users' routing spaces on Site1 and Site2.

  •  Configure VRFs vrf1 and vrf2 on CE.
  •  Create Layer 3 VLAN interfaces VLAN10 and VLAN20 on user access interface te-1/1/3, Layer 3 VLAN interfaces VLAN11 and VLAN21 on the interface te-1/1/4 connected to PE. Set the overlapping IP address 172.168.1.1 to VLAN10 and VLAN20, 192.168.2.1 to VLAN11 and VLAN2.
  •  Bind the Layer 3 VLAN interfaces VLAN10 and VLAN11 to vrf1, VLAN11 and VLAN21 to vrf2.
  •  Configure a static route for each VRF for data forwarding.

Procedure

Step1         Enable IP routing function before using VRF function.

 admin@XorPlus# set ip routing enable true

Step2        Create two VRFs.

admin@Xorplus# set ip vrf vrf1 description east
admin@Xorplus# set ip vrf vrf2 description east

Step3         Configure the VLAN.

admin@XorPlus# set vlans vlan-id 10
admin@XorPlus# set vlans vlan-id 20
admin@XorPlus# set vlans vlan-id 11
admin@XorPlus# set vlans vlan-id 21
admin@XorPlus#set interface gigabit-ethernet te-1/1/3 family ethernet-switching port-mode trunk
admin@XorPlus#set interface gigabit-ethernet te-1/1/3 family ethernet-switching vlan members 10
admin@XorPlus#set interface gigabit-ethernet te-1/1/3 family ethernet-switching vlan members 20
admin@XorPlus#set interface gigabit-ethernet te-1/1/4 family ethernet-switching port-mode trunk
admin@XorPlus#set interface gigabit-ethernet te-1/1/4 family ethernet-switching vlan members 11
admin@XorPlus#set interface gigabit-ethernet te-1/1/4 family ethernet-switching vlan members 21
admin@XorPlus# set vlan-interface interface vlan10 vif vlan10 address 172.168.1.1 prefix-length 24
admin@XorPlus# set vlan-interface interface vlan20 vif vlan20 address 172.168.1.1 prefix-length 24
admin@XorPlus# set vlan-interface interface vlan11 vif vlan11 address 192.168.2.1 prefix-length 24
admin@XorPlus# set vlan-interface interface vlan21 vif vlan21 address 192.168.2.1 prefix-length 24
admin@XorPlus# set vlans vlan-id 10 l3-interface vlan10
admin@XorPlus# set vlans vlan-id 20 l3-interface vlan20
admin@XorPlus# set vlans vlan-id 11 l3-interface vlan11
admin@XorPlus# set vlans vlan-id 21 l3-interface vlan21

Step4         Bind the Layer 3 VLAN interface to the VRF.

admin@XorPlus# set vlan-interface interface vlan10 vrf vrf1
admin@XorPlus# set vlan-interface interface vlan11 vrf vrf1
admin@XorPlus# set vlan-interface interface vlan20 vrf vrf2
admin@XorPlus# set vlan-interface interface vlan21 vrf vrf2

Step5         (Optional) Configure a static route entry into the VRF.

admin@XorPlus# set protocols static vrf vrf1 route 10.10.1.0/24 next-hop 172.168.1.1
admin@XorPlus# set protocols static vrf vrf2 route 10.10.1.0/24 next-hop 172.168.1.1


Verify the Configuration

  • You can use the run show vrf command to view the binding information between VRFs and the Layer 3 VLAN interfaces.
admin@Xorplus# run show vrf
Vrf          Description       Vlan Interfaces
----------      ---------------    -------------------------
vrf1                     vlan10,vlan11
vrf2                     vlan20,vlan21
  • You can use the run show route vrf command to check the routing table information of the specific VRF.
admin@Xorplus# run show route vrf vrf1
IPv4 Routing table: 2 routes
172.168.1.1/32     [local(0)/0]
                   > via vlan10/vlan10
172.168.1.0/24     [connected(0)/0]
                   > via vlan10/vlan10

admin@Xorplus# run show route vrf vrf2
IPv4 Routing table: 2 routes
172.168.1.1/32     [local(0)/0]
                   > via vlan20/vlan20
172.168.1.0/24     [connected(0)/0]
                   > via vlan20/vlan20
  • You can use the run show route forward-host command to check the information about the host hardware forwarding table information of the specific VRF, run show route forward-route command to check the hardware route forwarding table information of the specific VRF.

admin@XorPlus# run show route vrf vrf1 forward-route ipv4 all
Destination      NextHopMac         Port   
-----------     -----------------   ---------
172.168.1.0/24   04:7D:7B:62:93:FF   connected

Total route count:1
admin@Xorplus# run show route vrf vrf1 forward-host ipv4 all
Address        HWaddress        Port   
---------------   -----------------    ---------
172.168.1.1       04:7D:7B:62:93:FF    te-1/1/3    
Total host count:1  
  • No labels