Interfaces | 379For information on enabling and configuring Spanning Tree Protocol, see Chapter 10, Layer 2, on page 47.To view the interfaces in Layer 2 mode, use the command show interfaces switchport in the EXEC mode.Configure Layer 3 (Network) ModeWhen you assign an IP address to a physical interface, you place it in Layer 3 mode. Use the ip addresscommand and no shutdown command in INTERFACE mode to enable Layer 3 mode on an individualinterface. In all interface types except VLANs, the shutdown command prevents all traffic from passingthrough the interface. In VLANs, the shutdown command prevents Layer 3 traffic from passing through theinterface. Layer 2 traffic is unaffected by the shutdown command. One of the interfaces in the systemmust be in Layer 3 mode before you configure or enter a Layer 3 protocol mode (for example, OSPF).Figure 19-5 shows how the show config command displays an example of a Layer 3 interface.Figure 19-5. show config Command Example of a Layer 3 InterfaceIf an interface is in the incorrect layer mode for a given command, an error message is displayed to theuser. For example, in Figure 19-6, the command ip address triggered an error message because theinterface is in Layer 2 mode and the ip address command is a Layer 3 command only.Figure 19-6. Error Message When Trying to Add an IP Address to Layer 2 InterfaceTo determine the configuration of an interface, you can use the show config command in INTERFACEmode or the various show interface commands in EXEC mode.To assign an IP address, use both of the following commands in the INTERFACE mode:Command Syntax Command Mode Purposeno shutdown INTERFACE Enable the interface.FTOS(conf-if)#show config!interface GigabitEthernet 1/5ip address 10.10.10.1 /24no shutdownFTOS(conf-if)#FTOS(conf-if)#show config!interface GigabitEthernet 1/2no ip addressswitchportno shutdownFTOS(conf-if)#ip address 10.10.1.1 /24% Error: Port is in Layer 2 mode Gi 1/2.FTOS(conf-if)# Error message