10.1. Configuring VRF

Overview

Function Introduction

VPN is defined as a collection of sites sharing a common routing table. A customer site is connected to the service provider network by one or more interfaces, where the service provider associates each interface with a VPN routing table. A VPN routing table is called a VPN routing and forwarding (VRF) table. Beginning in privileged EXEC mode, follow these steps to configure one or more VRFs.

Principle Description

N/A

Configuration

step 1 Enter the configure mode

Switch# configure terminal

step 2 Create a vrf instance

Switch(config)# ip vrf vpn1
Switch(config-vrf)# rd 100:1
Switch(config-vrf)# router-id 1.1.1.1
Switch(config-vrf)# route-target both 100:1
Switch(config-vrf)# import map route-map

image26 Enter either an AS system number

step 3 Enter the interface configure mode and set the attributes of the interface

Switch(config-vrf)# interface eth-0-1
Switch(config-if)# no shutdown
Switch(config-if)# no switch
Switch(config-if)# ip vrf forwarding vpn1
Switch(config-if)# ip add 1.1.1.1/24
Switch(config-if)# end

step 4 Exit the configure mode

Switch(config)# end

step 5 Validation

The result of show information about the configured VRFs:

Switch# show ip vrf
VRF vpn1, FIB ID 1
Router ID: 1.1.1.1 (config)
Interfaces:
eth-0-1
Switch# show ip vrf interfaces vpn1
Interface IP-Address VRF Protocol
eth-0-1 1.1.1.1 vpn1 up
Switch# show ip vrf bgp brief
Name Default RD Interfaces
vpn1 100:1 eth-0-1
Switch# show ip vrf bgp detail
VRF vpn1; default RD 100:1
Interfaces:
eth-0-1
VRF Table ID = 1
Export VPN route-target communities
RT:100:1
Import VPN route-target communities
RT:100:1
import-map: route-map
No export route-map

Application cases

N/A