124 CHAPTER 12: IP ADDRESSING CONFIGURATION
c
CAUTION:
■ The primary IP address you assigned to the interface can overwrite the old one
if there is any.
■ An interface cannot be configured with a secondary IP address if the interface
has been configured to obtain an IP address through BOOTP or DHCP.
■ 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 37, VLAN-interface 1 on 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 access the external network
through the switch, and enable the hosts on the two network segments to
communicate with each other, do the following:
■ Assign a primary IP address and a secondary IP address to VLAN-interface 1 on
the switch.
■ Set the switch as the gateway on all hosts.
To do… Use the command… Remarks
Enter system view system-view --
Enter interface view interface interface-type
interface-number
--
Assign an IP address to the
interface
ip address ip-address { mask |
mask-length } [ sub ]
Required
No IP address is assigned by
default.