The ip address command configures an IP address for an interface.
The undo ip address command deletes the IP address of an interface.
By default, no IP address is configured for interfaces.
Parameter | Description | Value |
---|---|---|
ip-address |
Specifies an IP address. |
The value is in dotted decimal notation. |
mask |
Specifies a subnet mask. The IP address with the subnet mask of 255.255.255.255 can be assigned only to a Loopback interface. |
The value is in dotted decimal notation. |
mask-length |
Specifies the length of the subnet mask. The IP address with the subnet mask length of 32 can be assigned only to a Loopback interface. |
The value is an integer ranging from 0 to 32. |
sub |
Indicates a secondary IP address. To implement communication between subnets on one interface, configure secondary IP addresses. |
- |
100ge sub-interface view, 100GE interface view, 10GE sub-interface view, 10GE interface view, 200GE sub-interface view, 25GE sub-interface view, 25GE interface view, 400GE sub-interface view, 400GE interface view, 40GE sub-interface view, 40GE interface view, 50GE sub-interface view, 50GE interface view, Eth-Trunk sub-interface view, Eth-Trunk interface view, FlexE interface view, GE optical interface view, GE sub-interface view, GE interface view, GE electrical interface view, GMPLS-UNI interface view, Global VE sub-interface view, LMP interface view, Loopback interface view, Tunnel interface view, VBDIF interface view, VE sub-interface view, VLANIF interface view, Management interface view, Virtual template view
Usage Scenario
To configure an IP address and its mask for an interface, run the ip address command. This configuration allows the interface to access a network. To connect an interface to several subnets, configure several IP addresses for the interface, one of which is the primary IP address and the others are secondary IP addresses. Each interface can have a maximum of one primary IP address and 255 secondary IP addresses configured.
Configuration Impact
Precautions
<HUAWEI> system-view [~HUAWEI] interface GigabitEthernet0/1/1 [~HUAWEI-GigabitEthernet0/1/1] ip address 10.102.0.1 255.255.255.0 [*HUAWEI-GigabitEthernet0/1/1] ip address 10.38.160.1 255.255.255.0 sub