R3303-HP HSR6800 Routers Layer 3 - IP Services Configuration Guide

18
Assigning an IP address to an interface
You can assign an interface one primary address and multiple secondary addresses.
Generally, you only need to assign the primary address to an interface. In some cases, you must assign
secondary IP addresses to the interface. For example, if the interface connects to two subnets, to enable
the device to communicate with all hosts on the LAN, assign a primary IP address and a secondary IP
address to the interface.
Configuration guidelines
Follow these guidelines when you assign an IP address to an interface:
Each interface has 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 DHCP,
PPP address negotiation, or IP unnumbered.
The primary and secondary IP addresses you assign to the interface can be located on the same
subnet, but different interfaces on your device must reside on different subnets.
You can manually assign an IP address to an interface, or configure the interface to obtain an IP
address through DHCP or PPP address negotiation. If you change the way an interface obtains an
IP address, the new IP address overwrites the previous one.
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-length
| mask } [ sub ]
By default, no IP address is assigned to
any interface.
Configuration example
Network requirements
As shown in Figure 8, GigabitEthernet 2/1/1 on the router is connected to a LAN comprising two
s eg m e nts : 172.16.1.0 / 24 a nd 172.16. 2.0 /24 .
To enable the hosts on the two subnets to communicate with the external network through the router, and
to enable the hosts on the two subnets to communicate with each other:
Assign a primary IP address and a secondary IP address to GigabitEthernet 2/1/1 on the router.
Set the primary IP address of the router as the gateway address of the hosts on subnet
172.16.1.0/24, and the secondary IP address of the router as the gateway address of the hosts on
s u b n e t 172.16. 2.0/24 .