124
C
12: IP A
HAPTER
DDRESSING
c
IP Addressing
Configuration Example
C
ONFIGURATION
To do...
Enter system view
Enter interface view
Assign an IP address to the
interface
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.
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.
■
Use the command...
system-view
interface interface-type
interface-number
ip address ip-address { mask |
mask-length } [ sub ]
Remarks
--
--
Required
No IP address is assigned by
default.