Configuration example
Network requirements
As shown in
Ethernet 1/1 of Router A. Configure a static route destined for the host on Router B. Router B can receive
directed broadcasts from the host to IP address 2.2.2.255.
Figure 64 Network diagram
Configuration procedure
1.
Configure Router A:
# Specify IP addresses for Ethernet 1/1 and Ethernet 1/2.
<RouterA> system-view
[RouterA] interface ethernet 1/1
[RouterA-Ethernet1/1] ip address 1.1.1.2 24
[RouterA-Ethernet1/1] quit
[RouterA] interface ethernet 1/2
[RouterA-Ethernet1/2] ip address 2.2.2.2 24
# Enable Ethernet 1/2 to forward directed broadcasts destined for the directly connected network.
[RouterA-Ethernet1/2] ip forward-broadcast
2.
Configure Router B:
# Configure a static route to the host.
<RouterB> system-view
[RouterB] ip route-static 1.1.1.1 24 2.2.2.2
# Specify an IP address for Ethernet 1/2.
[RouterB] interface ethernet 1/2
[RouterB-Ethernet1/2] ip address 2.2.2.1 24
# Enable Ethernet 1/2 to receive directed broadcasts destined for the directly connected network.
[RouterB-Ethernet1/2] ip forward-broadcast
After the configurations, if you ping the subnet-directed broadcast address 2.2.2.255 on the host, the
interface Ethernet 1/2 of Router B can receive the ping packets. If you remove the ip forward-broadcast
configuration on any router, the interface Ethernet 1/2 of Router B cannot receive the ping packets.
Configuring MTU for an interface
When a packet exceeds the MTU of the output interface, the device processes it in one of the following
ways:
If the packet disallows fragmentation, the device discards it.
•
If the packet allows fragmentation, the device fragments it and forwards the fragments.
•
Fragmentation and reassembling consume system resources, so set an appropriate MTU for an interface
based on the network environment to avoid fragmentation.
Figure
64, the default gateway of the host is the IP address 1.1.1.2/24 of the interface
162