配置一个第三层界面

Procedure
  1. Change to the interface configuration context for the interface with the commandinterface.
  2. Enable routing support with the commandrouting.
  3. Assign an IPv4 address with the commandip address, or an IPv6 address with the commandipv6 address.
  4. If required, enable support for layer 3 counters with the commandl3-counters.
  5. If required, set the IP MTU with the commandip mtu.
  6. Review interface configuration settings with the commandshow interface.

Examples

This example creates the following configuration on the 6300 Switch Series:
  • Configures interface1/1/1as a layer 3 interface.
  • Defines an IPv4 address of10.10.20.209with a 24-bit mask.
switch#configswitch(config)#interface 1/1/1switch(config-if)#routingswitch(config-if)#ip address 10.10.20.209/24
This example creates the following configuration on the 6400 Switch Series:
  • Configures interface1/3/1as a layer 3 interface.
  • 定义了一个IPv6的广告dress of2001:0db8:85a3::8a2e:0370:7334with a 24-bit mask.
  • Enables layer 3 transmit and receive counters.
switch#configswitch(config)#interface 1/3/1switch(config-if)#routingswitch(config-if)#ipv6 address 2001:0db8:85a3::8a2e:0370:7334/24switch(config-if)#l3-counters txswitch(config-if)#l3-counters rx