
Figure 1-1 Network diagram for IP address configuration
As shown in the above figure, VLAN-interface
1 on Switch is connected to a LAN in which hosts belong to two subnets:
172.16.1.0/24 and 172.16.2.0/24. It is required to enable the hosts in the LAN
to communicate with external networks through Switch, and to enable the hosts
in the two network segments to communicate with each other.
|
Product series
|
Software version
|
Hardware version
|
|
S3610 Series Ethernet Switches
|
Release 5301
|
All versions
|
|
S5510 Series Ethernet Switches
|
Release 5301
|
All versions
|
|
S5500-SI Series Ethernet Switches
|
Release 1207
|
All versions except
S5500-20TP-SI
|
|
Release 1301
|
S5500-20TP-SI
|
|
S5500-EI Series Ethernet Switches
|
Release 2102
|
All versions
|
|
S7500E Series Ethernet Switches
|
Release 6100
|
All versions
|
Assign a primary IP address and a secondary
IP address to VLAN-interface 1 of Switch to ensure that all the hosts on the
LAN can access external networks through Switch. Set Switch as the gateway on
all the hosts of the two subnets to ensure that they can communicate with each
other.
# Assign a primary IP address and a
secondary IP address to VLAN-interface 1.
<Switch>
system-view
[Switch]
interface vlan-interface 1
[Switch-Vlan-interface1]
ip address 172.16.1.1 255.255.255.0
[Switch-Vlan-interface1]
ip address 172.16.2.1 255.255.255.0 sub
# Set the gateway address to 172.16.1.1 on
the hosts in subnet 172.16.1.0/24, and to 172.16.2.1 on the hosts in subnet
172.16.2.0/24.
# Ping Host B on Switch to verify the
connectivity to subnet 172.16.1.0/24.
<Switch>
ping 172.16.1.2
PING 172.16.1.2:
56 data bytes, press CTRL_C to break
Reply
from 172.16.1.2: bytes=56 Sequence=1 ttl=255 time=25 ms
Reply
from 172.16.1.2: bytes=56 Sequence=2 ttl=255 time=27 ms
Reply
from 172.16.1.2: bytes=56 Sequence=3 ttl=255 time=26 ms
Reply
from 172.16.1.2: bytes=56 Sequence=4 ttl=255 time=26 ms
Reply
from 172.16.1.2: bytes=56 Sequence=5 ttl=255 time=26 ms
--- 172.16.1.2
ping statistics ---
5
packet(s) transmitted
5
packet(s) received
0.00%
packet loss
round-trip
min/avg/max = 25/26/27 ms
Information shows that Switch and Host B
are reachable to each other.
# Ping Host A on Switch to verify the
connectivity to subnet 172.16.2.0/24.
<Switch>
ping 172.16.2.2
PING 172.16.2.2:
56 data bytes, press CTRL_C to break
Reply
from 172.16.2.2: bytes=56 Sequence=1 ttl=255 time=25 ms
Reply
from 172.16.2.2: bytes=56 Sequence=2 ttl=255 time=26 ms
Reply
from 172.16.2.2: bytes=56 Sequence=3 ttl=255 time=26 ms
Reply
from 172.16.2.2: bytes=56 Sequence=4 ttl=255 time=26 ms
Reply
from 172.16.2.2: bytes=56 Sequence=5 ttl=255 time=26 ms
--- 172.16.2.2
ping statistics ---
5
packet(s) transmitted
5
packet(s) received
0.00%
packet loss
round-trip min/avg/max = 25/25/26 ms
Information shows that Switch and Host A
are reachable to each other.
# Ping Host B on
Host A to verify the connectivity between subnet 172.16.1.0/24 and subnet
172.16.1.0/24. Ping Host B on Host A to verify that the ping operation is
successful.
#
interface
Vlan-interface1
ip
address 172.16.1.1 255.255.255.0
ip
address 172.16.2.1 255.255.255.0 sub
#
l
The primary IP address you assigned to the
interface can overwrite the old one if there is any.
l
You cannot assign secondary IP addresses to an interface
that has BOOTP, or DHCP configured.
l
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 interfaces on the switch must
reside on different network segments.

Figure 1-2 Network diagram for
configuring reception and forwarding of directed broadcasts
As shown in the figure above, the host’s
interface and VLAN-interface 3 on Switch A are on the same subnet (1.1.1.0/24).
VLAN-interface 2 on Switch A and VLAN-interface 2 on Switch B are on the other
subnet (2.2.2.0/24). Set the default gateway on the host to VLAN-interface 3 on
Switch A. Configure a static route to the host on Switch B.
|
Product series
|
Software version
|
Hardware version
|
|
S3610 Series Ethernet Switches
|
Release 5301
|
All versions
|
|
S5510 Series Ethernet Switches
|
Release 5301
|
All versions
|
|
S5500-SI Series Ethernet Switches
|
Release 1207
|
All versions except
S5500-20TP-SI
|
|
Release 1301
|
S5500-20TP-SI
|
|
S5500-EI Series Ethernet Switches
|
Release 2102
|
All versions
|
|
S7500E Series Ethernet Switches
|
Release 6100
|
All versions
|
l
Configure Switch A
# Enable Switch A to receive directed
broadcasts.
<SwitchA>
system-view
[SwitchA] ip
forward-broadcast
# Configure IP addresses for VLAN-interface
3 and VLAN-interface 2 respectively.
[SwitchA] interface
vlan-interface 3
[SwitchA-Vlan-interface3]
ip address 1.1.1.2 24
[SwitchA-Vlan-interface3]
quit
[SwitchA] interface
vlan-interface 2
[SwitchA-Vlan-interface2]
ip address 2.2.2.2 24
# Enable VLAN-interface 2 to forward
directed broadcasts.
[SwitchA-Vlan-interface2]
ip forward-broadcast
l
Configure Switch B
# Enable Switch B to receive directed
broadcasts.
<SwitchB>
system-view
[SwitchB]
ip forward-broadcast
# Configure a static route to the host.
[SwitchB] ip
route-static 1.1.1.1 24 2.2.2.2
# Configure an IP address for
VLAN-interface 2.
[SwitchB] interface
vlan-interface 2
[SwitchB-Vlan-interface2]
ip address 2.2.2.1 24
After the above configuration, if you ping
the subnet broadcast address (2.2.2.255) on the host, ping packets can be
received by VLAN-interface 2 of Switch B. However, if you undo the ip
forward-broadcast command, ping packets cannot be received by
VLAN-interface 2 of Switch B.
l
Configure Switch A
#
ip
forward-broadcast
#
interface
Vlan-interface2
ip
address 2.2.2.2 255.255.255.0
ip
forward-broadcast
#
interface
Vlan-interface3
ip address
1.1.1.2 255.255.255.0
l
Configure Switch B
#
ip
forward-broadcast
#
interface
Vlan-interface2
ip
address 2.2.2.1 255.255.255.0
#
ip
route-static 1.1.1.0 255.255.255.0 2.2.2.2
None.