02-19-2017 06:33 PM - edited 03-08-2019 09:24 AM
I am setting a vrf for the first time on a Nexus switch. I have configured Vlan in the vrf, then tried to add a static route, but it is not working. Config below:
======
vrf context INTERNET
!
interface Vlan11
description Routing Vlan for vrf INTERNET
no shutdown
vrf member INTERNET
ip address 10.0.32.10/24
!
interface Ethernet1/11
speed auto
description Link to ASA vrf INTERNET
switchport
switchport access vlan 11
spanning-tree port type edge
no shutdown
!
ip route 0.0.0.0/0 10.0.32.30 vrf INTERNET name NXTFW01 220
# I have tried adding the route without an admin distance & name, but it made no difference. It has an admin distance now as eventually I will set up a routing protocol to the ASA.
==================
In Vlan11, I have an ASA Firewall which I can reach:
NXTNEX01# ping 10.0.32.30 vrf INTERNET
PING 10.0.32.30 (10.0.32.30): 56 data bytes
64 bytes from 10.0.32.30: icmp_seq=0 ttl=254 time=1.363 ms
64 bytes from 10.0.32.30: icmp_seq=1 ttl=254 time=1.15 ms
The routing table for the vrf shows only Vlan11:
NXTNEX01# sho ip route vrf INTERNET
IP Route Table for VRF "INTERNET"
'*' denotes best ucast next-hop
'**' denotes best mcast next-hop
'[x/y]' denotes [preference/metric]
'%<string>' in via output denotes VRF <string>
10.0.32.0/24, ubest/mbest: 1/0, attached
*via 10.0.32.10, Vlan11, [0/0], 2d19h, direct
10.0.32.1/32, ubest/mbest: 1/0, attached
*via 10.0.32.1, Vlan11, [3/0], 2d19h, hsrp
10.0.32.10/32, ubest/mbest: 1/0, attached
*via 10.0.32.10, Vlan11, [0/0], 2d19h, local
# The static default route doesn't appear
Looking at the static routes for the vrf doesn't show anything:
NXTNEX01# sho ip static-route vrf INTERNET
NXTNEX01#
However, strangely looking at the static routes, there does seem to be something there:
NXTNEX01# sho ip static-route
Static-route for VRF "default"(1)
IPv4 Unicast Static Routes:
0.0.0.0/0, configured nh: 10.0.32.30/32%INTERNET
(installed in urib)
rnh(installed in urib)
0.0.0.0/0, configured nh: 10.71.1.254/32
(installed in urib)
rnh(installed in urib)
10.0.27.0/24, configured nh: 10.0.31.30/32
(installed in urib)
rnh(installed in urib)
...
# I am not sure if this is saying the static is in the default vrf.
The default route in the vrf certainly isn't working:
NXTNEX01# ping 10.0.27.10 vrf INTERNET
PING 10.0.27.10 (10.0.27.10): 56 data bytes
ping: sendto 10.0.27.10 64 chars, No route to host
Request 0 timed out
============
Anyone have any suggestions to add a static route to a vrf?
Thanks,
Andrew
Solved! Go to Solution.
02-19-2017 07:35 PM
Hello
Try this:
vrf context INTERNET
ip route 0.0.0.0/0 10.0.32.30
Masoud
02-19-2017 07:35 PM
Hello
Try this:
vrf context INTERNET
ip route 0.0.0.0/0 10.0.32.30
Masoud
02-19-2017 08:10 PM
Thanks for that, works perfectly. Confusing with the differences in configuring things between the ASA, Routers (IOS, IOS-XE) & Nexus switches. Would be nice if Cisco standardized the config.
02-19-2017 08:12 PM
You are welcome. Everybody is confused.
Masoud
Discover and save your favorite ideas. Come back to expert answers, step-by-step guides, recent topics, and more.
New here? Get started with these tips. How to use Community New member guide