4-4
To do…
Use the command…
Remarks
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.
z
An interface can have only one primary IP address. A newly configured primary IP address
overwrites the previous one.
z
You cannot assign secondary IP addresses to an interface that uses BOOTP, or DHCP to obtain
an IP address.
z
The primary and secondary IP addresses assigned to an interface can be located on the same
network segment, but the IP addresses of different interfaces must be on different network
segments.
IP Addressing Configuration Example
Network requirements
, 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.