Quick tip: VLAN interface status

Vijay sent me this question a while ago:

I have configured a L3 VLAN interface on a Cisco 3750 switch and assigned an IP address to it. I haven't assigned any ports to this VLAN. Why am I not able to ping the IP address of the VLAN interface from the switch itself?

The VLAN interface (like any other interface) has layer-1 and layer-2 state.

The layer-1 state is displayed in the Status column of the show ip interface brief command, the layer-2 state in the Protocol column.

A VLAN interface is always up, but its line protocol state tracks the state of attached ports: if at least one port is operational, the line protocol of the VLAN interface is up, otherwise it’s down. With no ports assigned to a VLAN, the line protocol of the VLAN interface is down, its IP address is not in the IP routing table and thus you cannot ping it.

This article is part of You've asked for it series.

14 comments:

Invitado said...

Hello, if there is not any port assigned to the vlan and up, the interface is down, so the only way is to put a
no keepalive in the interface vlan so it will remain up and also write ip routing to activate inter vlan routing.

kind regards

Paul said...

Agreed. The SVI interface (interface vlan x) is not always up. It's only up when the following are true.

The vlan is created (show vlan brief)
At least one port that is associated to that VLAN is up

OR

The no keepalive option is enabled.

Ivan Pepelnjak said...

The "no keepalive" option does not work on my router (1800, 12.4(15)T). On which box did it work for you?

Invitado said...

I tried on physical interfaces, I didn't on logical but I always thought that this works on int vlans...

Christoph said...

Try "no autostate" instead, that should do it...

that1guy said...

"With no ports assigned to a VLAN, the line protocol of the VLAN interface is down"

Dont forget this also includes trunk ports. I see this from time to time.

alvarezp said...

Thanks for the "no autostate" tip!

Diosbejgli said...

you can enter into vlan configuration, by vlan <id> and issue the "state active" command, and your Vlan interface will be up/up.

Ivan Pepelnjak said...

Does not work on my SOHO router (181x, 12.4(15)T). The autostate calculation AND the VLAN state must be active for the interface to be up/up.

mzi said...

Understanding and Troubleshooting the Autostate Feature in Catalyst Switches

http://www.cisco.com/en/US/products/hw/switches/ps700/products_tech_note09186a0080160b14.shtml

Ivan Pepelnjak said...

Thanks for the link. See also the follow-up post:

http://blog.ioshints.info/2009/07/followup-vlan-interface-status.html

Guest said...

this helped me. thanks

zdr said...

hello,

maybe you can comment on the following case:

I have a vlan subinterface that always remains up
the client route attached to the subinterface will always be advertised by my IGP from this subinterface even when the remote CPE is down

Is there anyway to get a vlan subinterface to go down if the mac adresse of the remote CPE disparrears?

thanks

Ivan Pepelnjak said...

You probably need reliable static routing, BFD for static routes or Ethernet OAM.

Ivan Pepelnjak, CCIE#1354, is the chief technology advisor for NIL Data Communications. He has been designing and implementing large-scale data communications networks as well as teaching and writing books about advanced technologies since 1990. See his full profile, contact him or follow @ioshints on Twitter.