Where we can use VRF (Virtual Routing and Forwarding) if we don't have our own MPLS network and we are not ISP? One of the things that we can use is to seperate specific interfaces and routing table, so it appears as two routers.
My goal is not to describe how VRF works, it's presents here:
http://www.cisco.com/en/US/tech/tk436/tk428/technologies_configuration_example09186a00800a6c11.shtml
I would like to presents configuration of VRF on this example:
Let's say we would like to seperate interfaces Fa0/0 and Fa0/1 from Fa0/2 and Fa0/3 keeping two seperate routing tables, so it could not communicate with each other.
First lets define new VRF and name it Mngt:
VRF(config)#ip vrf Mngt
VRF(config-vrf)#rd 127.0.0.1:1
Now, we need to assign interfaces to our new VRF:
VRF(config)#int fa0/0
VRF(config-subif)#ip vrf forwarding Mngt
VRF(config-subif)#ip address 192.168.1.1 255.255.255.0
VRF(config)#int fa0/1
VRF(config-subif)#ip vrf forwarding Mngt
VRF(config-subif)#ip address 192.168.2.1 255.255.255.0
Fa0/2 and Fa0/3 will be in global routing table, so we don't need the "ip vrf forwarding " command.
VRF(config)#int fa0/2
VRF(config-subif)#ip address 10.0.1.1 255.255.255.0
VRF(config)#int fa0/3
VRF(config-subif)#ip address 10.0.2.1 255.255.255.0
This commnad display assignment of interfaces to VRF:
VRF#show ip vrf
Name Default RD Interfaces
Mngt 127.0.0.1:1 FastEthernet0/0
FastEthernet0/1
Here is how to display both routing tables - vrf Mngt and global:
Global routing table:
VRF# show ip route
[...]
C 10.0.1.0/24 is directly connected, FastEthernet0/2
C 10.0.2.0/24 is directly connected, FastEthernet0/3
VRF Mngt routing table:
VRF# show ip route vrf Mngt
[...]
C 192.168.1.0/24 is directly connected, FastEthernet0/0
C 192.168.2.0/24 is directly connected, FastEthernet0/1
Lets test global routing table with ping:
VRF#ping 10.0.1.2
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 10.0.1.2, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 8/35/80 ms
VRF#ping 10.0.2.2
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 10.0.2.2, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 8/48/156 ms
And here ping to VRF Mngt interface doesn't work:
VRF#ping 192.168.1.2
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 192.168.1.2, timeout is 2 seconds:
....
Success rate is 0 percent (0/5), round-trip min/avg/max
Here is how we ping IP in VRF
VRF#ping vrf Mngt 192.168.1.2
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 192.168.1.2, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 4/28/68 ms
VRF#ping vrf Mngt 192.168.2.2
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 192.168.2.2, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 4/28/68 ms