Example: Enabling an interface to forward directed broadcasts destined for the directly connected network
Network configuration
As shown in Figure 56, 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 56: Network diagram
Procedure
IMPORTANT: By default, interfaces on the device are disabled (in ADM or Administratively Down state). To have an interface operate, you must use the undo shutdown command to enable that interface. | ||
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
Verifying the configuration
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.