The Moose and Squirrel Files

March 19, 2010

Using VRF’s to Simulate Physical Routers

Filed under: Network — Tags: , — networknerd @ 3:36 pm

I recently had the need to test a frame-relay configuration that was soon to be commissioned, but didn’t have a spare pair of routers to connect  to. VRF to the rescue.  VRF’s are a technology that allow multiple instances of the routing table to exist within one physical device. NB: This is not a new concept (see here), just a record of my work. The only real limitation when you do this on a production router is that you need one  interface per VRF interconnection. 

I had an unused two port E1 card in a Cisco 3845 router, making the testing easy.  One VRF for each E1 interface,  an E1 crossover cable and I was good to go.  Once the E1 controller channel group is configured a new serial port is created. This was the final config I used, and fortunately the frame relay pvc’s came up straight away. Mission accomplished. 

An important point to remember with VRF’s is that many of the usual commands have VRF specific variations. To do a ping test with this configuration you need to use the ping VRF command as shown below, or else you’ll just be using what’s in the global routing table.
router#ping vrf E1-0/0/0
Protocol [ip]:
Target IP address:
Repeat count [5]:
Datagram size [100]:
Timeout in seconds [2]:
Extended commands [n]: y
Source address or interface: Serial0/0/0:0.37
Type of service [0]:
Set DF bit in IP header? [no]:
Validate reply data? [no]:
Data pattern [0xABCD]:
Loose, Strict, Record, Timestamp, Verbose[none]:
Sweep range of sizes [n]:
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to, timeout is 2 seconds:
Packet sent with a source address of
Success rate is 100 percent (5/5), round-trip min/avg/max = 1/2/4 ms
router#sh ip route vrf E1-0/0/0

Routing Table: E1-0/0/0
Codes: C - connected, S - static, R - RIP, M - mobile, B - BGP
D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
E1 - OSPF external type 1, E2 - OSPF external type 2
i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2
ia - IS-IS inter area, * - candidate default, U - per-user static route
o - ODR, P - periodic downloaded static route

Gateway of last resort is not set is subnetted, 1 subnets
C is directly connected, Serial0/0/0:0.37

! Create the two VRF's and assign route distinguishers
ip vrf E1-0/0/0
rd 100:0
ip vrf E1-0/0/1
rd 200:1
! Configure the E1 controllers. They need to be joined with an E1 crossover cable
controller E1 0/0/0
  channel-group 0 timeslots 1-31 speed 64
controller E1 0/0/1
  channel-group 0 timeslots 1-31 speed 64

! Configure the serial controller on E1 0/0/0 with frame-relay encapsulation
! Note that one of the two serial interfaces has to be Frame-relay DCE when using a crossover.
interface Serial0/0/0:0
  no ip address
  encapsulation frame-relay IETF
  frame-relay lmi-type q933a
  frame-relay intf-type dce
interface Serial0/0/0:0.37 point-to-point
  no ip address
  ip vrf forwarding E1-0/0/0
  ip address
  frame-relay interface-dlci 37
interface Serial0/0/1:0
  no ip address
  encapsulation frame-relay IETF
  frame-relay lmi-type q933a
interface Serial0/0/1:0.37 point-to-point
  ip vrf forwarding E1-0/0/1
  ip address
  frame-relay interface-dlci 37


Blog at