To manage an Ethernet switch remotely
through Telnet or network management, the switch need to be assigned an IP
address. As for a H3C series Layer 2 Ethernet switch, only the management VLAN
interface can be assigned an IP address.
You can assign an IP address to a
management VLAN interface in one of the following three ways:
l
Using commands to assign IP addresses
l
Through BOOTP (In this case, the switch operates
as a BOOTP client.)
l
Through dynamic host configuration protocol (DHCP)
(In this case, the switch operates as a DHCP client)
The three above mentioned ways are mutually
exclusive. That is, the IP address obtained in a new way overwrites the one
obtained in the previously configured way and the overwritten IP address is
then released. For example, if you assign an IP address to a VLAN interface by
using the corresponding commands and then apply for another IP address through
BOOTP (using the ip address bootp-alloc command), the former IP address
will be removed, and the final IP address of the VLAN interface is the one
obtained through BOOTP.
A static route is configured manually by an
administrator. You can make a network with relatively simple topology to
operate properly by simply configuring static routes for it. Configuring and using
static routes wisely helps to improve network performance and can guarantee bandwidth
for important applications.
The disadvantages of static route lie in
that: When a fault occurs or the network topology changes, static routes may
become unreachable, which in turn results in network failures. In this case,
manual configurations are needed to recover the network.
To access an S3100-SI series Ethernet
switch through networks, you can configure static routes for it.
1.2 Management VLAN Configuration
Before configuring the management VLAN, make
sure the VLAN operating as the management VLAN exists. If VLAN 1 (the default
VLAN) is the management VLAN, just go ahead.
Table 1-1 Configure the management VLAN
|
Operation
|
Command
|
Remark
|
|
Enter system view
|
system-view
|
—
|
|
Configure a specified VLAN to be the
management VLAN
|
management-vlan vlan-id
|
Required
By default, VLAN 1 operates as the
management VLAN.
|
|
Add a default route
|
ip route-static 0.0.0.0 0.0.0.0 { Null null-interface-number | next-hop
} [ preference preference-value ] [ reject | blackhole
] [ description text ]
|
Required
|
|
Create the management VLAN interface and
enter VLAN interface view
|
interface vlan-interface vlan-id
|
Required
|
|
Assign an IP address to the management
VLAN interface
|
ip address
ip-address mask [ sub ]
|
Required
By default, the management VLAN interface
has no IP address.
|
|
Provide a description string for the management
VLAN interface
|
description string
|
Optional
By default, the description string of the
management VLAN interface is “Vlan-interface vlan-id Interface”.
|
|
Shut down
the management VLAN interface
|
Shutdown
|
Optional
By
default, a management VLAN interface is down if all the Ethernet ports in the
management VLAN are down; a management VLAN interface is up if one or more
Ethernet ports in the management VLAN are up.
|
|
Bring up the management VLAN interface
|
undo shutdown
|
Caution:
l
To configure the management VLAN of a switch operating
as a cluster management device to be a cluster management VLAN (using the management-vlan
vlan-id command) successfully, make sure the vlan-id argument
provided in the management-vlan vlan-id command is consistent
with that of the management VLAN.
l
Shutting down or bringing up a management VLAN interface
has no effect on the up/down status of the Ethernet ports in the management
VLAN.
If the Stack function
is enabled on the switch, the secondary devices of a stack will repeatedly
joint and leave the primary device after you use the shutdown command on
the management VLAN interface. This is normal and can be recovered after you
use the undo shutdown command on the management VLAN interface.
I. Network requirements
The administrator wants to manage the
switch H3CA remotely through Telnet. The requirements are as follows: H3CA has
an IP address, and the route between H3CA and the remote console is reachable.
You need to configure the switch as
follows:
l
Assigning an IP address to the management VLAN
interface
l
Configuring a default route
II. Configuration procedure
# Enter system view.
<H3CA> system-view
# Create VLAN 10 and configure VLAN 10 to be
the management VLAN.
[H3CA] vlan 10
[H3CA-vlan10] quit
[H3CA] management-vlan 10
# Create the VLAN 10 interface and enter
VLAN interface view.
[H3CA] interface vlan-interface 10
# Configure the IP address of VLAN 10 interface
to be 1.1.1.1.
[H3CA-Vlan-interface10] ip address
1.1.1.1 255.255.255.0
[H3CA-Vlan-interface10] quit
# Configure a default route.
[H3CA] ip route-static 0.0.0.0 0.0.0.0
1.1.1.2
Table 1-2 Display and management VLAN
|
Operation
|
Command
|
Description
|
|
Display
the IP-related information about a management VLAN interface
|
display
ip interface [ brief [ Vlan-interface [
vlan-id ] ] | [ Vlan-interface vlan-id ] ]
|
Optional
You can
execute the display commands in any view.
|
|
Display
the information about a management VLAN interface
|
display interface vlan-interface [ vlan-id ]
|
|
Display summary
information about the routing table
|
display
ip routing-table
|
|
Display
detailed information about the routing table
|
display
ip routing-table verbose
|
|
Display
the routes leading to a specified IP address
|
display
ip routing-table ip-address [ mask ] [ longer-match ] [ verbose ]
|
|
Display
the routes leading to specified IP addresses
|
display
ip routing-table ip-address1 mask1 ip-address2
mask2 [ verbose ]
|
|
Display
the routing information of the specified protocol
|
display
ip routing-table protocol protocol
[ inactive | verbose ]
|
|
Display
the routes filtered by a specified access control list (ACL)
|
display
ip routing-table acl acl-number [ verbose
]
|
|
Display
the routing table in a tree structure
|
display
ip routing-table radix
|
|
Display
the statistics of the routing table
|
display
ip routing-table statistics
|
|
Delete all static routes
|
delete static-routes all
|
Optional
You can execute this command in system
view.
|
As the network scale expands and the
network complexity increases, the network configurations become more and more
complex accordingly. It is usually the case that the computer locations change
(such as the portable computers or wireless networks) or the number of the
computers exceeds that of the available IP addresses. The dynamic host configuration
protocol (DHCP) is developed to meet these requirements. It adopts the client/server
model. The DHCP client requests configuration information from the DHCP server
dynamically, and the DHCP server returns corresponding configuration
information based on policies.
A typical DHCP implementation usually
involves a DHCP server and multiple clients (such as PCs and portable computers),
as shown in Figure 2-1.

Figure 2-1 A typical DHCP implementation
The interactions between a DHCP client and the
DHCP server are shown in Figure 2-2.

Figure 2-2 Interaction between a DHCP client and the DHCP server
To obtain valid dynamic IP addresses, a DHCP
client exchanges different information with the DHCP server in different
phases. Usually, the following three modes are involved:
1)
The DHCP client accesses the network for the
first time
In this case, the DHCP client goes through
the following four phases to establish connections with the DHCP server.
l
Discovery. The DHCP client discovers a DHCP
server by broadcasting DHCP_Discover packets in the network. Only the DHCP
servers respond to this type of packets.
l
Offer. Upon receiving DHCP_Discover packets, a
DHCP server select an available IP address from an address pool and sends a DHCP_Offer
packet that carries the selected IP address and other configuration information
to the DHCP client. The DHCP client only accepts the first-arrived DHCP_Offer
packet (if there are many DHCP servers), and broadcasts a DHCP_Request packet
to each DHCP server. The packet contains the IP address carried by the DHCP_Offer
packet.
l
Acknowledgement. Upon receiving the DHCP_Request
packet, the DHCP server that owns the IP address the DHCP_Request packet
carries sends a DHCP_ACK packet to the DHCP client. In this way, the DHCP
client binds TCP/IP protocol components to its MAC address.
l
IP addresses offered by other DHCP servers (if
any) through DHCP_Offer packets but not selected by the DHCP client are still
available for other clients.
2)
The DHCP client accesses the network for the
second time
In this case, the DHCP client establishes
connections with the DHCP server through the following steps.
l
After accessing the network successfully for the
first time, the DHCP client can access the network again by broadcasting a DHCP_Request
packet that contains the IP address assigned to it last time instead of a DHCP_Discover
packet.
l
Upon receiving the DHCP_Request packet and, when
the IP address applied by the client is available, the DHCP server that owns
the IP address responds with a DHCP_ACK packet to enable the DHCP client to use
the IP address again.
l
If the IP address is not available (for example,
it is assigned to another DHCP client), the DHCP server responds with a
DHCP_NAK packet, which enables the DHCP client to request for a new IP address
by sending a DHCP_Discover packet once again.
3)
The DHCP client extends the lease of an IP
address
IP addresses assigned dynamically are only valid
for a specified period of time and the DHCP servers reclaim their assigned IP
addresses at the expiration of these periods. Therefore, the DHCP client must
be able to extend the period if it is to use a dynamically assigned IP address
for a period longer than allowed.
By default, a DHCP client updates its IP
address lease automatically by sending DHCP_Request packets to the DHCP server
when half of the specified period expires. The DHCP server, in turn, responds with
a DHCP_ACK packet to notify the DHCP client of the new lease if the IP address
is still available. The DHCP clients implemented by the switches support this
lease auto-update process.
A BOOTP client can request the server for
an IP address through BOOTP. It goes through the following two phases to apply
for an IP address.
l
Sending a BOOTP request packet to the server
l
Processing the BOOTP response packet received from
the server
To obtain an IP address through BOOTP, a BOOTP
client first sends a BOOTP request packet to the server. Upon receiving the
request packet, the server returns a BOOTP response packet. The BOOTP client then
retrieves the assigned IP address from the response packet.
The BOOTP packets are based on user
datagram protocol (UDP). To ensure reliable packet transmission, a timer is triggered
when the BOOTP client sends a request packet to the server. If no response
packet from the server is received after the timer times out, the client resends
the request packet. The packet is resent every five seconds and three times at
most. After that, no packet is resent if there is still no response packet from
the server.
An S3100-SI series Ethernet switch can operate
as a DHCP/BOOTP client. In this case, the IP address of the management VLAN
interface is obtained through DHCP/BOOTP.
Before configuring the management VLAN, you
need to create the VLAN to be operating as the management VLAN. As VLAN1 is created
by default, you do not need to create it if you configure VLAN 1 to be the
management VLAN..
Table 2-1 Configure DHCP/BOOTP client
|
Operation
|
Command
|
Remark
|
|
Enter system view
|
system-view
|
Required
|
|
Configure a specified VLAN to be the
management VLAN
|
management-vlan vlan-id
|
Required
By default, VLAN 1 operates as the
management VLAN.
|
|
Create the management VLAN interface and
enter VLAN interface view
|
interface vlan-interface vlan-id
|
Required
|
|
Configure the way in which the management
VLAN interface obtains an IP address
|
ip address { bootp-alloc | dhcp-alloc }
|
Required
By default, no IP address is assigned to the
management VLAN interface.
|
|
Display the information about the BOOTP
client
|
display bootp client [ interface vlan-interface vlan-id ]
|
Optional
You can execute these two commands in any
view.
|
|
Display the information about the DHCP client
|
display dhcp client [ verbose ]
|
As a DHCP client,
an S3100-SI switch can occupy an IP address for up to 24 days. That is, even if
the lease period of the address pool on the DHCP server is longer than 24 days,
the DHCP client can only obtain a 24-day lease.
I. Network requirements
To manage the switch H3CA remotely, which
operates as a DHCP client, through Telnet, The following are required:
l
H3CA address is obtained through DHCP
l
The route between H3CA and the remote console is
reachable
To achieve this, you need to perform the
following configuration for the switch:
l
Configuring the management VLAN interface to obtain
an IP address through DHCP
l
Configuring a default route
II. Configuration procedures
# Enter system view.
<H3CA> system-view
# Create VLAN 10 and configure VLAN 10 to
be the management VLAN.
[H3CA] vlan 10
[H3CA-vlan10] quit
[H3CA] management-vlan 10
# Create VLAN 10 interface and enter VLAN
interface view.
[H3CA] interface vlan-interface 10
# Configure the management VLAN interface
to obtain an IP address through DHCP.
[H3CA-Vlan-interface10] ip address dhcp-alloc
[H3CA-Vlan-interface10] quit
# Configure a default route.
[H3CA] ip route-static 0.0.0.0 0.0.0.0
1.1.1.2