26
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.
Configuration guidelines
Follow these guidelines when you assign an IP address to an interface:
• 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, DHCP, PPP address negotiation, or IP unnumbered.
• 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.
Configuration procedure
To assign an IP address to an interface:
Step Command Remarks
1. Enter system view.
system-view
N/A
2. Enter interface view.
interface
interface-type
interface-number
N/A
3. Assign an IP address to the
interface.
ip
address
ip-address { mask |
mask-length } [
sub
]
By default, no IP address is
assigned to the interface.
Configuring IP unnumbered
Typically, you assign an IP address to an interface either manually or through DHCP. If the IP
addresses are not enough, or the interface is used only occasionally, you can configure an interface
to borrow an IP address from other interfaces. This is called IP unnumbered, and the interface
borrowing the IP address is called IP unnumbered interface.
You can use IP unnumbered to save IP addresses either when available IP addresses are
inadequate or when an interface is brought up only for occasional use.
Configuration guidelines
Follow these guidelines when you configure IP unnumbered:
• Loopback interfaces cannot borrow IP addresses of other interfaces, but other interfaces can
borrow IP addresses of loopback interfaces.
• An interface cannot borrow an IP address from an unnumbered interface.
• Multiple interfaces can use the same unnumbered IP address.
• If an interface has multiple manually configured IP addresses, only the manually configured
primary IP address can be borrowed.