As shown in Figure 1-1, the router connects to the PC through GE1/0/0. The IP addresses of the router and PC are 10.10.10.26/30 and 10.10.10.25/30. Users can successfully ping 10.10.10.27 which is a broadcast address from the PC. In theory, however, ping to a broadcast address cannot succeed.
Figure 1-1 Pinging a broadcast address
Step 1 Obtain the packet header when ping from the PC to the broadcast address 10.10.10.27 is performed.
Dec 25 2014 15:46:12.806 HNYGJ-GuanYuWang-HW_NE20E-S8 %%01PP4/7/ip_packet(d):VS=Admin-VS-CID=0x66271b;Receiving, ifIndex = 6, version = 4, headlen = 20, tos = 0, pktlen = 0x3c, pktid = 0x1d76, offset = 0x0, ttl = 62, protocol = 1, checksum = 0xe52b, s = 10.10.10.25, d = 10.10.10.27
The source address of the packet is 10.10.10.25 and the destination address is 10.10.10.27 which is the broadcast address of the network to which 10.10.10.25 is connected.
Step 2 Run the display ip routing-table command in the user view of the router to view routing table information.
Route Flags: R - relay, D - download to fib
Routing Table : public
Summary Count : 1
Destination/Mask Proto Pre Cost Flags NextHop Interface
10.10.10.27/32 Direct 0 0 D 127.0.0.1 GigabitEtherne 1/0/0
All devices in this network segment including the router can receive the packet because the destination address is a broadcast address. The router sends the packet to the CPU for processing.
Step 3 The CPU processes the packet and determines that it is an ICMP request packet. The CPU then switches the source and destination IP addresses of the ICMP packet, and forwards the ICMP request packet.
Dec 25 2014 15:46:12.806 HNYGJ-GuanYuWang-HW_NE20E-S8 %%01PP4/7/ip_packet(d):VS=Admin-VS-CID=0x66271b;Sending, ifIndex = 6, version = 4, headlen = 20, tos = 0, pktlen = 0x3c, pktid = 0xa, offset = 0x0, ttl = 255, protocol = 1, checksum = 0x4197, s = 10.10.10.27, d = 10.10.10.25
In this manner, the source destination changes to 10.10.10.27, and the destination address changes to 10.10.10.25. The ICMP request packet can then successfully arrive at the PC.
In conclusion, no error occurs in the entire process of the router. Then troubleshoot the PC. After the PC sends the ICMP request packet, the packet matches a direct route and is sent out from the interface with the IP address 10.10.10.25. The PC queries the IP address 10.10.10.27 in the ARP table, but the IP address 10.10.10.27 does not exist in the dynamic ARP table.
However, the packet reaches the router. We can estimate that a static ARP entry is configured on the PC.
Step 4 Run the arp –a command on the PC to view ARP entries on the PC.
Interface: 10.135.20.167 --- 0xd
Internet Address Physical Address Type
10.10.10.26 e0-97-96-bd-93-3b dynamic
10.10.10.27 ff-ff-ff-ff-ff-ff static
220.127.116.11 01-00-5e-00-00-16 static
18.104.22.168 01-00-5e-00-00-fe static
Static ARP entries are configured on the PC, which is the root cause for a successful ping to a broadcast address.
Static ARP entries are configured on the PC.
Run the arp -d ip mac command on the PC to delete static ARP entries.