This command enables routing on a VLAN. The vlanid value has a range from 1 to 4093. The [interface ID] value has a range from 1 to 128. Typically, you will not supply the interface ID argument, and the system automatically selects the interface ID. However, if you specify an interface ID, the interface ID becomes the port number in the unit/slot/port for the VLAN routing interface. If you select an interface ID that is already in use, the CLI displays an error message and does not create the VLAN interface. For products that use text-based configuration, including the interface ID in the vlan routing command for the text configuration ensures that the unit/slot/port for the VLAN interface stays the same across a restart. Keeping the unit/slot/port the same ensures that the correct interface configuration is applied to each interface when the system restarts.
Format | vlan routing vlanid [interface ID] |
Mode | VLAN Database |
Example: Example 1 shows the command specifying a vlanid value. The interface ID argument is not used.
(Switch)(Vlan)#vlan 14 (Switch)(Vlan)#vlan routing 14 ? <cr> Press enter to execute the command. <1-24> Enter interface ID
Typically, you press <Enter> without supplying the Interface ID value; the system automatically selects the interface ID.
Example: In Example 2, the command specifies interface ID 51 for VLAN 14 interface. The interface ID becomes the port number in the unit/slot/port for the VLAN routing interface. In this example, unit/slot/port is 4/51 for VLAN 14 interface.
(Switch)(Vlan)#vlan 14 51 (Switch)(Vlan)# (Switch)#show ip vlan MAC Address used by Routing VLANs: 00:11:88:59:47:36 Logical VLAN ID Interface IP Address Subnet Mask ------- -------------- --------------- --------------- 10 4/1 172.16.10.1 255.255.255.0 11 4/50 172.16.11.1 255.255.255.0 12 4/3 172.16.12.1 255.255.255.0 13 4/4 172.16.13.1 255.255.255.0 14 4/51 0.0.0.0 0.0.0.0 <--u/s/p is 4/51 for VLAN 14 interface
Example: In Example 3, you select an interface ID that is already in use. In this case, the CLI displays an error message and does not create the VLAN interface.
(Switch) #show ip vlan MAC Address used by Routing VLANs: 00:11:88:59:47:36 Logical VLAN ID Interface IP Address Subnet Mask ------- -------------- --------------- --------------- 10 4/1 172.16.10.1 255.255.255.0 11 4/50 172.16.11.1 255.255.255.0 12 4/3 172.16.12.1 255.255.255.0 13 4/4 172.16.13.1 255.255.255.0 14 4/51 0.0.0.0 0.0.0.0 (Switch)#config (Switch)(Config)#exit (Switch)#vlan database (Switch)(Vlan)#vlan 15 (Switch)(Vlan)#vlan routing 15 1 Interface ID 1 is already assigned to another interface
Example: The show running configuration command always lists the interface ID for each routing VLAN, as shown in Example 4 below.
(Switch) #show running-config !!Current Configuration: ! !System Description "Trident 56846 Development System - 48xTenGig + 4 FortyGig , R.7.28.4, Linux 2.6.34.6" !System Software Version "R.7.28.4" !System Up Time "0 days 8 hrs 38 mins 3 secs" !Cut-through mode is configured as disabled !Additional Packages BGP-4,QOS,Multicast,IPv6,IPv6 Management,Metro,Routing,Data Center !Current SNTP Synchronized Time: SNTP Client Mode Is Disabled ! vlan database exit configure no logging console aaa authentication enable "enableNetList" none line console serial timeout 0 exit line telnet exit line ssh exit ! router rip exit router ospf exit ipv6 router ospf exit exit