Configuring VRF-lite: Catalyst 4500 Series Switch Command Reference and Related Publications at This Location
Configuring VRF-lite: Catalyst 4500 Series Switch Command Reference and Related Publications at This Location
Configuring VRF-lite: Catalyst 4500 Series Switch Command Reference and Related Publications at This Location
Configuring VRF-lite
Virtual Private Networks (VPNs) provide a secure way for customers to share bandwidth over an ISP
backbone network. A VPN is a collection of sites sharing a common routing table. A customer site is
connected to the service provider network by one or more interfaces, and the service provider associates
each interface with a VPN routing table. A VPN routing table is called a VPN routing/forwarding (VRF)
table.
With the VRF-lite feature, the Catalyst 4500 series switch supports multiple VPN routing/forwarding
instances in customer edge devices. (VRF-lite is also termed multi-VRF CE, or multi-VRF Customer
Edge Device). VRF-lite allows a service provider to support two or more VPNs with overlapping IP
addresses using one interface.
Note Starting with Cisco IOS Release 12.2(52)SG, the Catalyst 4500 switch supports VRF lite NSF support
with routing protocols OSPF/EIGRP/BGP.
Note The switch does not use Multiprotocol Label Switching (MPLS) to support VPNs. For information about
MPLS VRF, refer to the Cisco IOS Switching Services Configuration Guide at:
http://www.cisco.com/en/US/docs/ios/mpls/configuration/guide/mp_vpn_ipv4_ipv6_ps6922_TSD_Pro
ducts_Configuration_Guide_Chapter.html
Note For complete syntax and usage information for the switch commands used in this chapter, see the Cisco
Catalyst 4500 Series Switch Command Reference and related publications at this location:
http://www.cisco.com/en/US/products/hw/switches/ps4324/index.html
If the command is not found in the Cisco Catalyst 4500 Command Reference, you can locate it in the
larger Cisco IOS library. Refer to the Cisco IOS Command Reference and related publications at this
location:
http://www.cisco.com/en/US/products/ps6350/index.html
About VRF-lite
VRF-lite is a feature that enables a service provider to support two or more VPNs, where IP addresses
can be overlapped among the VPNs. VRF-lite uses input interfaces to distinguish routes for different
VPNs and forms virtual packet-forwarding tables by associating one or more Layer 3 interfaces with
each VRF. Interfaces in a VRF can be either physical, such as Ethernet ports, or logical, such as VLAN
SVIs, but a Layer 3 interface cannot belong to more than one VRF at any time.
Figure 1-1 Catalyst 4500 Series Switches Acting as Multiple Virtual CEs
VPN 1 VPN 1
CE PE PE CE
Catalyst 4500 MPLS Catalyst 4500
Si Si
switch network switch
MPLS-VRF MPLS-VRF
router router
VPN 2 VPN 2
99721
CE = Customer edge device
PE = Provider edge router
• Multicast VRF is supported on Supervisor Engine 6-E, Supervisor 6L-E, Catalyst 4900M, and
Catalyst 4948E.
• The capability vrf-lite subcommand under router ospf should be used when configuring OSPF as
the routing protocol between the PE and the CE.
Configuring VRFs
To configure one or more VRFs, perform this task:
Command Purpose
Step 1 Switch# configure terminal Enters global configuration mode.
Step 2 Switch(config)# ip routing Enables IP routing.
Step 3 Switch(config)# ip vrf vrf-name Names the VRF and enters VRF configuration mode.
Step 4 Switch(config-vrf)# rd Creates a VRF table by specifying a route distinguisher.
route-distinguisher
Enter either an AS number and an arbitrary number
(xxx:y) or an IP address and arbitrary number
(A.B.C.D:y).
Step 5 Switch(config-vrf)# route-target Creates a list of import, export, or import and export route
{export | import | both}
route-target-ext-community
target communities for the specified VRF. Enter either an
AS system number and an arbitrary number (xxx:y) or an
IP address and an arbitrary number (A.B.C.D:y).
Note This command is effective only if BGP is running.
Step 6 Switch(config-vrf)# import map (Optional) Associates a route map with the VRF.
route-map
Step 7 Switch(config-vrf)# interface Enters interface configuration mode and specify the Layer
interface-id
3 interface to be associated with the VRF. The interface
can be a routed port or SVI.
Step 8 Switch(config-if)# ip vrf forwarding Associates the VRF with the Layer 3 interface.
vrf-name
Step 9 Switch(config-if)# end Returns to privileged EXEC mode.
Step 10 Switch# show ip vrf [brief | detail Verifies the configuration. Displays information about the
| interfaces] [vrf-name]
configured VRFs.
Step 11 Switch# copy running-config (Optional) Saves your entries in the configuration file.
startup-config
Note For complete syntax and usage information for the following commands, see the switch command
reference for this release and see the Cisco IOS Switching Services Command Reference at:
http://www.cisco.com/en/US/docs/ios/ipswitch/command/reference/isw_book.html
Use the no ip vrf vrf-name global configuration command to delete a VRF and to remove all interfaces
from it. Use the no ip vrf forwarding interface configuration command to remove an interface from the
VRF.
Command Purpose
Switch# show ip arp vrf vrf-name Displays the ARP table (static and dynamic entries) in the specified
VRF.
Switch(config)# arp vrf vrf-name Creates a static ARP entry in the specified VRF.
ip-address mac-address ARPA
Command Purpose
Switch# ping vrf vrf-name ip-host Pings an IP host or address in the specified VRF.
Command Purpose
Step 1 Switch# configure terminal Enters global configuration mode.
Step 2 Switch(config)# snmp-server trap Enables SNMP traps for packets on a VRF.
authentication vrf
Step 3 Switch(config)# snmp-server engineID Configures a name for the remote SNMP engine on a switch.
remote host vrf vpn-instance
engine-id string
Step 4 Switch(config)# snmp-server host Specifies the recipient of an SNMP trap operation and specifies the VRF
host vrf vpn-instance traps table to be used for sending SNMP traps.
community
Step 5 Switch(config)# snmp-server host Specifies the recipient of an SNMP inform operation and specifies the
host vrf vpn-instance informs VRF table to be used for sending SNMP informs.
community
Step 6 Switch(config)# snmp-server user Adds a user to an SNMP group for a remote host on a VRF for SNMP
user group remote host vrf vpn- access.
instance security model
Step 7 Switch(config)# end Returns to privileged EXEC mode.
Command Purpose
Step 1 Switch# configure terminal Enters global configuration mode.
Step 2 Switch(config)# interface Enters interface configuration mode and specifies the Layer 3 interface
interface-id to configure.
Step 3 Switch(config-if)# no switchport Removes the interface from Layer 2 configuration mode if it is a
physical interface.
Step 4 Switch(config-if)# ip vrf forwarding Configures VRF on the interface.
vrf-name
Step 5 Switch(config-if-vrf)# ip address Enters the IP address for the interface.
ip-address subnet-mask
Step 6 Switch(config-if-vrf)# ip verify Enables uRPF on the interface.
unicast source reachable-via
rx allow-default
Step 7 Switch(config-if-vrf)# end Returns to privileged EXEC mode.
Command Purpose
Step 1 Switch# configure terminal Enters global configuration mode.
Step 2 Switch(config)# logging on Enables or temporarily disables logging of storage router event
message.
Step 3 Switch(config)# logging host Specifies the host address of the syslog server where logging messages
ip-address vrf vrf-name are to be sent.
Step 4 Switch(config)# logging buffered Logs messages to an internal buffer.
logging buffered size debugging
Step 5 Switch(config)# logging trap Limits the logging messages sent to the syslog server.
debugging
Step 6 Switch(config)# logging facility Sends system logging messages to a logging facility.
facility
Step 7 Switch(config)# end Returns to privileged EXEC mode.
Command Purpose
traceroute vrf vrf-name ipaddress Specifies the name of a VPN VRF in which to find the destination
address.
Command Purpose
Step 1 Switch# configure terminal Enters global configuration mode.
Command Purpose
Step 2 Switch(config)# ip ftp Specifies the source IP address for FTP connections.
source-interface interface-type
interface-number
Step 3 Switch(config)# end Returns to privileged EXEC mode.
To specify the IP address of an interface as the source address for TFTP connections, use the
ip tftp source-interface show mode command. To return to the default, use the no form of this
command.
Command Purpose
Step 1 Switch# configure terminal Enters global configuration mode.
Step 2 Switch(config)# ip tftp Specifies the source IP address for TFTP connections.
source-interface interface-type
interface-number
Step 3 Switch(config)# end Returns to privileged EXEC mode.
Command Purpose
Switch# telnet ip-address/vrf Connects through Telnet to an IP host or address in the specified VRF.
vrf-name
Switch# ssh -l username -vrf Connects through SSH to an IP host or address in the specified VRF.
vrf-name ip-host
Command Purpose
Switch# ntp server vrf vrf-name Configure the NTP server in the specified VRF.
ip-host
Switch# ntp peer vrf vrf-name Configure the NTP peer in the specified VRF.
ip-host
Example:
Switch (config-sg-tacacs+)# server-private
10.1.1.1 port 19 key cisco
Step 12 Switch (config-sg-tacacs+)# ip vrf forwarding Configures the VRF reference of a AAA TACACS+ server
vrf-name group.
Step 13 Switch (config-sg-tacacs+)# ip tacacs Uses the IP address of a specified interface for all outgoing
source-interface subinterface-name TACACS+ packets.
Step 14 Switch (config-sg-tacacs)# exit Exits server-group configuration mode.
The following example lists all the steps to configure per-VRF TACACS+:
Switch> enable
Switch# configure terminal
Switch (config)# ip vrf cisco
Switch (config-vrf)# rd 100:1
Switch (config-vrf)# exit
Switch (config)# interface Loopback0
Switch (config-if)# ip vrf forwarding cisco
Switch (config-if)# ip address 10.0.0.2 255.0.0.0
Switch (config-if)# exit
Switch (config-sg-tacacs+)# ip vrf forwarding cisco
Switch (config-sg-tacacs+)# ip tacacs source-interface Loopback0
Switch (config-sg-tacacs)# exit
For more information about configuring per-VRF for TACACS+ server, see the
Cisco IOS Per VRF for TACACS + Server, Release 12.3(7)T.
Command Purpose
Step 1 Switch# configure terminal Enters global configuration mode.
Step 2 Switch(config)# ip routing Enables IP routing.
Step 3 Switch(config)# ip vrf vrf-name Names the VRF and enters VRF configuration mode.
Step 4 Switch(config-vrf)# ip (Optional) Enables global multicast routing for VRF table.
multicast-routing vrf vrf-name
Step 5 Switch(config-vrf)# rd Creates a VRF table by specifying a route distinguisher.
route-distinguisher
Enter either an AS number and an arbitrary number
(xxx:y) or an IP address and arbitrary number
(A.B.C.D:y).
Step 6 Switch(config-vrf)# route-target Creates a list of import, export, or import and export route
{export | import | both}
route-target-ext-community
target communities for the specified VRF. Enter either an
AS system number and an arbitrary number (xxx:y) or an
IP address and an arbitrary number (A.B.C.D:y).
The route-target-ext-community value should be the same
as the route-distinguisher value entered in Step 4.
Step 7 Switch(config-vrf)# import map (Optional) Associates a route map with the VRF.
route-map
Step 8 Switch(config-vrf)# interface Enters interface configuration mode and specifies the
interface-id
Layer 3 interface to be associated with the VRF. The
interface can be a routed port or a SVI.
Step 9 Switch(config-if)# ip vrf forwarding Associates the VRF with the Layer 3 interface.
vrf-name
Step 10 Switch(config-if)# ip address Configures IP address for the Layer 3 interface.
ip-address mask
Step 11 Switch(config-if)# ip pim Enables PIM on the VRF-associated Layer 3 interface.
[sparse-dense mode | dense-mode |
sparse-mode]
Step 12 Switch(config-if)# end Returns to privileged EXEC mode.
Step 13 Switch# show ip vrf [brief | detail | Verifies the configuration. Display information about the
interfaces] [vrf-name]
configured VRFs.
Step 14 Switch# copy running-config (Optional) Saves your entries in the configuration file.
startup-config
For more information about configuring a multicast within a Multi-VRF CE, see the
Cisco IOS IP Multicast Configuration Guide, Release 12.4.
Use the no ip vrf vrf-name global configuration command to delete a VRF and to remove all interfaces
from it. Use the no ip vrf forwarding interface configuration command to remove an interface from the
VRF.
Command Purpose
Step 1 Switch# configure terminal Enters global configuration mode.
Step 2 Switch(config)# router ospf Enables OSPF routing, specifies a VPN forwarding table,
process-id vrf vrf-name and enters router configuration mode.
Step 3 Switch(config-router)# (Optional) Logs changes in the adjacency state (the default
log-adjacency-changes state).
Step 4 Switch(config-router)# redistribute Sets the switch to redistribute information from the BGP
bgp autonomous-system-number subnets network to the OSPF network.
Step 5 Switch(config-router)# network Defines a network address and mask on which OSPF runs
network-number area area-id and the area ID for that network address.
Step 6 Switch(config-router)# end Returns to privileged EXEC mode.
Step 7 Switch# show ip ospf process-id Verifies the configuration of the OSPF network.
Step 8 Switch# copy running-config (Optional) Saves your entries in the configuration file.
startup-config
Use the no router ospf process-id vrf vrf-name global configuration command to disassociate the VPN
forwarding table from the OSPF routing process.
Command Purpose
Step 1 Switch# configure terminal Enters global configuration mode.
Step 2 Switch(config)# router bgp Configures the BGP routing process with the AS number
autonomous-system-number passed to other BGP routers and enters router
configuration mode.
Step 3 Switch(config-router)# network Specifies a network and mask to announce using BGP.
network-number mask network-mask
Step 4 Switch(config-router)# redistribute Sets the switch to redistribute OSPF internal routes.
ospf process-id match internal
Step 5 Switch(config-router)# network Defines a network address and mask on which OSPF runs
network-number area area-id and the area ID for that network address.
Step 6 Switch(config-router-af)# Defines BGP parameters for PE to CE routing sessions and
address-family ipv4 vrf vrf-name enters VRF address-family mode.
Step 7 Switch(config-router-af)# neighbor Defines a BGP session between PE and CE routers.
address remote-as as-number
Command Purpose
Step 8 Switch(config-router-af)# neighbor Activates the advertisement of the IPv4 address family.
address activate
Step 9 Switch(config-router-af)# end Returns to privileged EXEC mode.
Step 10 Switch# show ip bgp [ipv4] [neighbors] Verifies BGP configuration.
Step 11 Switch# copy running-config (Optional) Saves your entries in the configuration file.
startup-config
Use the no router bgp autonomous-system-number global configuration command to delete the BGP
routing process. Use the command with keywords to delete routing characteristics.
VPN1 Si Si
3/3
PE = Provider edge router
Configuring Switch S8
On switch S8, enable routing and configure VRF.
Switch# configure terminal
Enter configuration commands, one per line. End with CNTL/Z.
Switch(config)# ip routing
Switch(config)# ip vrf v11
Switch(config-vrf)# rd 800:1
Switch(config-vrf)# route-target export 800:1
Switch(config-vrf)# route-target import 800:1
Switch(config-vrf)# exit
Switch(config)# ip vrf v12
Switch(config-vrf)# rd 800:2
Switch(config-vrf)# route-target export 800:2
Switch(config-vrf)# route-target import 800:2
Switch(config-vrf)# exit
Configure the loopback and physical interfaces on switch S8. Fast Ethernet interface 3/5 is a trunk
connection to the PE. Interfaces 3/7 and 3/11 connect to VPNs:
Switch(config)# interface loopback1
Switch(config-if)# ip vrf forwarding v11
Switch(config-if)# ip address 8.8.1.8 255.255.255.0
Switch(config-if)# exit
Configure the VLANs used on switch S8. VLAN 10 is used by VRF 11 between the CE and the PE.
VLAN 20 is used by VRF 12 between the CE and the PE. VLANs 118 and 208 are used for VRF for the
VPNs that include switch S11 and switch S20, respectively:
Switch(config)# interface Vlan10
Switch(config-if)# ip vrf forwarding v11
Switch(config-if)# ip address 38.0.0.8 255.255.255.0
Switch(config-if)# exit
Router(config)# ip vrf v2
Router(config-vrf)# rd 100:2
Router(config-vrf)# route-target export 100:2
Router(config-vrf)# route-target import 100:2
Router(config-vrf)# exit
Router(config)# ip cef
Router(config)# interface Loopback1
Router(config-if)# ip vrf forwarding v1
Router(config-if)# ip address 3.3.1.3 255.255.255.0
Router(config-if)# exit
Command Purpose
Switch# show ip protocols vrf vrf-name Displays routing protocol information associated
with a VRF.
Switch# show ip route vrf vrf-name [connected] [protocol Displays IP routing table information associated
[as-number]] [list] [mobile] [odr] [profile] [static] with a VRF.
[summary][supernets-only]
Switch# show ip vrf [brief | detail | interfaces] [vrf-name] Displays information about the defined VRF
instances.
Switch# show ip mroute vrf instance-name a.b.c.d | active | Displays information about the defined VRF
bidriectional| count | dense| interface | proxy | pruned | instances.
sparse | ssm | static | summary
This example shows how to display multicast route table information within a VRF instance:
Switch# show ip mroute vrf mcast2 234.34.10.18
IP Multicast Routing Table
Flags: D - Dense, S - Sparse, B - Bidir Group, s - SSM Group, C - Connected,
L - Local, P - Pruned, R - RP-bit set, F - Register flag,
T - SPT-bit set, J - Join SPT, M - MSDP created entry,
X - Proxy Join Timer Running, A - Candidate for MSDP Advertisement,
U - URD, I - Received Source Specific Host Report,
Z - Multicast Tunnel, z - MDT-data group sender,
Y - Joined MDT-data group, y - Sending to MDT-data group
V - RD & Vector, v - Vector
Outgoing interface flags: H - Hardware switched, A - Assert winner
Timers: Uptime/Expires
Interface state: Interface, Next-Hop or VCD, State/Mode
Note For more information about the information in the displays, refer to the Cisco IOS Switching Services
Command Reference at:
http://www.cisco.com/en/US/docs/ios/ipswitch/command/reference/isw_book.html