23
Assigning an IP address to an interface
About manual IP address assignment
An interface can have one primary address and multiple secondary addresses.
Typically, you need to configure a primary IP address for an interface. If the interface connects to
multiple subnets, configure primary and secondary IP addresses on the interface so the subnets can
communicate with each other through the interface.
Restrictions and guidelines
• An interface can have only one primary IP address. A newly configured primary IP address
overwrites the previous one.
• You cannot assign secondary IP addresses to an interface that obtains an IP address through
BOOTP or DHCP.
• The primary and secondary IP addresses assigned to the interface can be located on the same
network segment. Different interfaces on your device must reside on different network
segments.
• You can assign interfaces IP addresses that have different masks but the same network
address if ANDed with the shortest mask. For example, 1.1.1.1/16 and 1.1.2.1/24 have the
same network address 1.1.0.0 if ANDed with 255.255.0.0. You can assign the IP addresses to
two interfaces on the device. By default, users connected to the two interfaces cannot
communicate with each other. For the users to communicate, you must configure common
proxy ARP on the device. For more information, see "Configuring proxy ARP."
Procedure
1. Enter system view.
system-view
2. Enter interface view.
interface interface-type interface-number
3. Assign an IP address to the interface.
ip address ip-address { mask-length | mask } [ sub ]
By default, no IP address is assigned to the interface.
Display and maintenance commands for IP
addressing
Execute display commands in any view.
Task Command
Display IP configuration and statistics for the
specified or all Layer 3 interfaces.
display
ip
interface
[
interface-type
interface-number
]
Display brief IP configuration for Layer 3
interfaces.
display
ip
interface
[ interface-type
[ interface-number ] ]
brief
[
description
]