626
C
40: IP A
HAPTER
DDRESSING
c
IP Addressing
Configuration Example
C
ONFIGURATION
To do...
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.
You cannot assign secondary IP addresses to an interface using BOOTP, DHCP,
■
or PPP address negotiation.
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, a primary interface and its
subinterfaces, or the subinterfaces on a father interface must reside on
different network segments.
Network requirements
As shown in
Figure
187, Ethernet1/0 on a router 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 Router, 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 Ethernet 1/0 on the
■
router.
Set the router as the gateway on all hosts.
■
Network diagram
Figure 187 Network diagram for IP address configuration
172.16.1.0/24
Router
Host B
Eth1/0
172.16.1.1 /24
172 .16 .1 .2/24
172.16.2.1 /24 sub
172 .16.2.2/24
Host A
172.16.2.0/24
Use the command...
interface interface-type
interface-number
ip address ip-address { mask |
mask-length } [ sub ]
Remarks
--
Required
No IP address is assigned by
default.