Cisco CLI Error: % Configuring IP routing on a LAN subinterface is only allowed if that subinterface is already configured as part of an IEEE 802.10, IEEE 802.1Q, or ISL vLAN

When does this error message appear?

This error message appears while attempting to configure an IP address on a subinterface of a Layer 3 interface.

What does this error message mean?

This error message indicates that the subinterface must be assigned to a VLAN before we can configure an IP address for the subinterface.

What is the most common occurence of this error?

After a new subinterface has been created we may be tempted to configure an IP address for the subinterface right away. However, we cannot configure an IP address on a subinterface without first specifying a VLAN ID for the subinterface.

Example

Router Console
Router#configure terminal
Enter configuration commands, one per line. End with CNTL/Z.
Router(config)#interface gi0/0.1
Router(config-if)#ip address 10.0.0.1 255.255.255.0

% Configuring IP routing on a LAN subinterface is only allowed if that
subinterface is already configured as part of an IEEE 802.10, IEEE 802.1Q,
or ISL vLAN.

Router(config-if)#

In the example above, a new subinterface (gi0/0.1) is created. Immediately after creating the subinterface, we attempt to configure an IP address (10.0.0.1 /24) on the subinterface.

The error message indicates that we need to assign the subinterface to a VLAN before we can configure an IP address on it.

Solution

The solution to this error is to assign the subinterface to the desired VLAN first, before configuring an IP address on it. We can use the encapsulation command to assign the interface to the desired VLAN.

For our example, we will assign subinterface gi0/0.1 to VLAN 10 using the command: encapsulation dot1q 10. Once the subinterface is assigned to a VLAN, we are then able to configure an IP address on the subinterface.

Router Console
Router#configure terminal
Enter configuration commands, one per line. End with CNTL/Z.
Router(config)#interface gi0/0.1
Router(config-if)#ip address 10.0.0.1 255.255.255.0

% Configuring IP routing on a LAN subinterface is only allowed if that
subinterface is already configured as part of an IEEE 802.10, IEEE 802.1Q,
or ISL vLAN.

Router(config-if)#encapsulation dot1q 10
Router(config-if)#ip address 10.0.0.1 255.255.255.0
Router(config-if)#

VLANs, trunking, inter-vlan routing and subinterfaces are covered in detail in teh following interactive section of this website: CCNA 200-301 Interactive Modules and Labs.

Want to test your networking skills with hands-on configuration and troubleshooting questions? Try out the Workshops section of this website here: CCNA 200-301 Consolidation Labs (Login required).

Learn about the industry's only browser-native network device simulators here: Connected Dots browser-native network device simulators

 
Planning to take the CCNA exam, or simply looking to level up your networking skills?
Look no further. Try our interactive courses.