Unable to set an IP address on subinterfaces
I'm trying to setup a router-on-a-stick config in my practice lab but for some reason I'm unable to configure the subinterface as part of an 802.1q. I know that I have to type encapsulation dot1q and the associated vlan but the command is detected as invalid. When I use the help command, encapsulation is not even included in the list.
R2#conf t Enter configuration commands, one per line. End with CNTL/Z. R2(config)#int f0/0.20 R2(config-subif)#ip address 192.168.20.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. R2(config-subif)#? Interface configuration commands: arp Set arp type (arpa, probe, snap) or timeout backup Modify backup parameters bandwidth Set bandwidth informational parameter bgp-policy Apply policy propagated by bgp community string bridge-group Transparent bridging interface parameters cdp CDP interface subcommands default Set a command to its defaults delay Specify interface throughput delay description Interface specific description exit Exit from interface configuration mode glbp Gateway Load Balancing Protocol interface commands ip Interface Internet Protocol config commands keepalive Enable keepalive llc2 LLC2 Interface Subcommands mtu Set the interface Maximum Transmission Unit (MTU) netbios Use a defined NETBIOS access list or enable name-caching no Negate a command or set its defaults ntp Configure NTP rate-limit Rate Limit service-policy Configure QoS Service Policy shutdown Shutdown the selected interface snapshot Configure snapshot support on the interface snmp Modify SNMP interface parameters standby HSRP interface configuration commands timeout Define timeout values for this interface traffic-shape Enable Traffic Shaping on an Interface or Sub-Interface vrrp VRRP Interface configuration commands