Configuring a layer 3 interface
Procedure
-
Change to the interface configuration context for the interface with the command
interface
. -
Enable routing support with the command
routing
. -
Assign an IPv4 address with the command
ip address
, or an IPv6 address with the commandipv6 address
. -
If required, enable support for layer 3 counters with the command
l3-counters
. -
If required, set the IP MTU with the command
ip mtu
. -
Review interface configuration settings with the command
show interface
.
Examples
This example creates the following configuration on the 6300 Switch Series:
- Configures interface 1/1/1 as a layer 3 interface.
- Defines an IPv4 address of 10.10.20.209 with a 24-bit mask.
switch# config switch(config)# interface 1/1/1 switch(config-if)# routing switch(config-if)# ip address 10.10.20.209/24
This example creates the following configuration on the 6400 Switch Series:
- Configures interface 1/3/1 as a layer 3 interface.
- Defines an IPv6 address of 2001:0db8:85a3::8a2e:0370:7334 with a 24-bit mask.
- Enables layer 3 transmit and receive counters.
switch# config switch(config)# interface 1/3/1 switch(config-if)# routing switch(config-if)# ipv6 address 2001:0db8:85a3::8a2e:0370:7334/24 switch(config-if)# l3-counters tx switch(config-if)# l3-counters rx