Configuring a Primary IP Address for an Interface
Procedure
- Run system-view
The system view is displayed.
- Run interface interface-type interface-number[.subinterface-number]
The interface view or sub-interface view is displayed.
Only the E series, X series, F series, and SC series cards support Ethernet sub-interface configuration. For details about the cards, see Cards in the Hardware Description.
- Only hybrid and trunk interfaces on the preceding series of cards support Layer 2 Ethernet sub-interface configuration.
After you run the undo portswitch command to switch Layer 2 interfaces on the preceding series of cards into Layer 3 interfaces, you can configure Layer 3 Ethernet sub-interfaces on the interfaces.
The SA series cards do not support Ethernet sub-interface configuration and cannot forward IP traffic to Ethernet sub-interfaces on other cards.
You are advised to add a member interface to an Eth-Trunk and then configure an Eth-Trunk sub-interface. The Eth-Trunk sub-interface can be successfully configured only when the card on which the member interface locates supports Ethernet sub-interface configuration.
- VLAN termination sub-interfaces cannot be created on a VCMP client.
- (Optional) On an Ethernet interface, run undo portswitch
The interface is switched to Layer 3 mode.
By default, an Ethernet interface works in Layer 2 mode.
- Run ip address ip-address { mask | mask-length }
A primary IP address is configured for the interface.
By default, no IP address is configured for an interface.
Each interface has only one primary IP address. If you configure a new primary IP address for an interface, the original one is deleted and the new primary IP address takes effect.