1-4
z
The primary IP address you assigned to the interface can overwrite the old one if there is any.
z
You cannot assign secondary IP addresses to an interface that has BOOTP or DHCP configured.
z
The primary and secondary IP addresses you assign to the interface can be located on the same
network segment. However, this should not violate the rule that different physical interfaces on your
device must reside on different network segments.
IP Addressing Configuration Example
Network requirements
As shown in
Figure 1-3
, a port in VLAN 1 on a switch is connected to a LAN comprising two segments:
172.16.1.0/24 and 172.16.2.0/24.
To enable the hosts on the two network segments to communicate with the external network through the
switch, and the hosts on the LAN can communicate with each other, do the following:
z
Assign two IP addresses to VLAN-interface 1 on the switch.
z
Set the switch as the gateway on all PCs in the two networks.
Figure 1-3
Network diagram for IP addressing configuration
Configuration procedure
# Assign a primary IP address and a secondary IP address to VLAN-interface 1.
<Switch> system-view
[Switch] interface vlan-interface 1
[Switch-Vlan-interface1] ip address 172.16.1.1 255.255.255.0
[Switch-Vlan-interface1] ip address 172.16.2.1 255.255.255.0 sub
# Set the gateway address to 172.16.1.1 on the PCs attached to subnet 172.16.1.0/24, and to
172.16.2.1 on the PCs attached to subnet 172.16.2.0/24.
# Ping a host on subnet 172.16.1.0/24 from the switch to check the connectivity.