Configuration example
Network requirements
As shown in Figure 53, the default gateway of the host is the IP address 1.1.1.2/24 of VLAN-interface 3 of Switch A.
Switch B can receive directed broadcasts from the host to IP address 2.2.2.255.
Figure 53: Network diagram
Configuration procedure
Configure Switch A:
# Specify IP addresses for VLAN-interface 3 and VLAN-interface 2.
<SwitchA> system-view [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 directed for the directly connected network.
[SwitchA-Vlan-interface2] ip forward-broadcast
Configure Switch B:
# Configure a static route to the host.
<SwitchB> system-view [SwitchB] ip route-static 1.1.1.1 24 2.2.2.2
# Specify an IP address for VLAN-interface 2.
[SwitchB] interface vlan-interface 2 [SwitchB-Vlan-interface2] ip address 2.2.2.1 24
After the configurations are completed, if you ping the subnet-directed broadcast address 2.2.2.255 on the host, VLAN-interface 2 of Switch B can receive the ping packets. If you delete the ip forward-broadcast configuration on any switch, the interface cannot receive the ping packets.