Assign an IP address to a Port

Assign an IP address to a port so that it supports routing operations.

Before you begin

  • Ensure routing (forwarding) is globally enabled.

  • Ensure the VLAN is configured.

  • If required, ensure the VRF instance exists.

About this task

Use a brouter port to route IP packets and to bridge all nonroutable traffic. The routing interface of the brouter port is not subject to the spanning tree state of the port. A brouter port can be in the blocking state for nonroutable traffic and still route IP traffic. This feature removes interruptions caused by Spanning Tree Protocol recalculations in routed traffic.

If you configure an IP interface without specifying the VRF instance, it maps to VRF 0 by default.

Procedure

  1. Enter GigabitEthernet Interface Configuration mode:

    enable

    configure terminal

    interface GigabitEthernet {slot/port[/sub-port][-slot/port[/sub-port]][,...]}

    Note

    Note

    If the platform supports channelization and the port is channelized, you must also specify the sub-port in the format slot/port/sub-port.

  2. Assign an IP address to the port:

    brouter port {slot/port[/sub-port]} vlan <2-4059> subnet <A.B.C.D/X> [mac-offset <0-511> | name WORD <0-64> | state-disabled]

  3. Optional: If required, associate the port with a VRF:

    vrf WORD<1-16>

  4. Confirm that the configuration is correct:

    show brouter [<1-4059>]

Example

Assign an IP address to a port:

Switch:1>enable
Switch:1#configure terminal
Switch:1(config)#interface gigabitethernet 1/11
Switch:1(config-if)#brouter port 1/11 vlan 2202 subnet 47.17.10.31/255.255.255.0

Variable Definitions

Use the data in the following table to use the brouter port command.

Variable

Value

mac-offset <0-511>

Specifies a number by which to offset the MAC address from the chassis MAC address. This ensures that each IP address has a different MAC address. If you omit this variable, a unique MAC offset is automatically generated.

name WORD <0-64>

Specifies the IP address name in the range of 0 to 64 characters.

{slot/port[/sub-port]}

Identifies a single slot and port. If the platform supports channelization and the port is channelized, you must also specify the sub-port in the format slot/port/sub-port.

state-disabled

Creates the IP interface in an administratively disabled state. This parameter is useful if you want to preconfigure an IP interface, including the routing protocol configuration for that interface, and enable it later during a maintenance window. By default, the switch enables an IP interface after you configure the primary IP address.

subnet <A.B.C.D/X>

Specifies the IP address and subnet mask (0–32).

<2-4059>

Specifies the VLAN ID that is used if the port is tagged (802.1q encapsulation). The VLAN ID is unique to the switch and is not used if the port is untagged.

Use the data in the following table to use the show brouter command.

Variable

Value

<1-4059>

Specifies the VLAN ID that is used if the port is tagged (802.1q encapsulation). The VLAN ID is unique to the switch and is not used if the port is untagged.