22-5
Software Configuration Guide—Release 12.2(25)SG
OL-7659-03
Chapter22 Configuring Layer 3 Inter faces
Configuring Physical Layer 3 Interfaces
To configure physical Layer 3 interfaces, perform this task:This example shows how to configure an IP address on Fast Ethernet interface 2/1:
Switch# configure terminal
Enter configuration commands, one per line. End with CNTL/Z.
Switch(config)# ip routing
Switch(config)# interface fastethernet 2/1
Switch(config-if)# no switchport
Switch(config-if)# ip address 10.1.1.1 255.255.255.248
Switch(config-if)# no shutdown
Switch(config-if)# end
Switch#
This example uses the show running-config command to display the interface IP address configuration of Fast Ethernet interface 2/1:
Switch# show running-config
Building configuration...
!
interface FastEthernet2/1
no switchport
ip address 10.1.1.1 255.255.255.248
!
ip classless
no ip http server
!
!
line con 0
line aux 0
line vty 0 4
!
end
Command Purpose
Step1 Switch(config)#ip routing Enables IP routing (Required only if disabled.)
Step2 Switch(config)# interface {fastethernet |
gigabitethernet | tengigabitethernet}
slot
/
port
}
| {port-channel

port_channel_number

}
Selects an interface to configure.
Step3 Switch(config-if)#no switchport Converts this port from physical Layer 2 port to physical
Layer 3 port.
Step4 Switch(config-if)# ip address ip_address

subnet_mask

Configures the IP address and IP subnet.
Step5 Switch(config-if)# no shutdown Enables the interface.
Step6 Switch(config-if)# end Exits configuration mode.
Step7 Switch# copy running-config startup-config Saves your configuration changes to NVRAM.
Step8 Switch# show interfaces [

type slot/interface

]
Switch# show ip interfaces [

type slot/interface

]
Switch# show running-config interfaces [

type

slot/interface
]
Verifies the configuration.