No ARP response from gateway

Christopher Garman picture Christopher Garman · Sep 14, 2012 · Viewed 11.4k times · Source

I'm developing an embedded system that has to communicate with the outside world over 10Base-T ethernet. I have built all functions required to serve web pages, including ARP, IP, TCP, ICMP (ping), HTTP and portions of FTP. Now, I need to build the rest of the code, which will allow me to act as a client. All the above-mentioned protocols have been working well from the server standpoint for several months.

Now, I need to build the client half of these protocols, to request data from other servers. Step 1 is to ARP for the hardware address of the remote server. As I understand it, since the server is on another network, my gateway should respond with its MAC address so that I know to pass all packets destined for that IP to my gateway. Here's the problem:

My device (192.168.1.251, on subnet mask 255.255.255.0) doesn't get an ARP response from my gateway (192.168.1.1) or any machine outside of the network. However, my device (X.251) does get an ARP response from my laptop (192.168.1.100) which is under the same router.

I'm certain that my basic ARP ethernet frame structure is correct, because I reply to ARP requests correctly every time. The difference is in the OPERATION field, which is either a 1 or 2 depending on REQUEST or REPLY.


Here's my device's (192.168.1.251) request to the gateway (192.168.1.1), which gets no response:

FF FF FF FF FF FF <-- destination MAC - broadcast (also tried 0x00)

00 04 A3 7F C1 57 <-- source MAC - my device

08 06 <-- ARP

00 01 <-- ethernet

08 00 <-- IP

06 <-- 6 byte MAC addresses

04 <-- 4 byte IP addresses

00 01 <-- request (2 = reply)

00 04 A3 7F C1 57 <-- sender MAC - mine

C0 A8 01 FB <-- sender IP - mine = 192.168.1.251

00 00 00 00 00 00 <-- target MAC - unknown, reason for request

C0 A8 01 01 <-- target IP - gateway = 192.168.1.1

00 00 00 00 ..... 00 00 00 <-- trailer of 18 sets of 00 for padding


Now, my device's (192.168.1.251) nearly identical request to my laptop (192.168.1.100), which gets a valid response:

FF FF FF FF FF FF <-- destination MAC - broadcast (also tried 0x00)

00 04 A3 7F C1 57 <-- source MAC - my device

08 06 <-- ARP

00 01 <-- ethernet

08 00 <-- IP

06 <-- 6 byte MAC addresses

04 <-- 4 byte IP addresses

00 01 <-- request (2 = reply)

00 04 A3 7F C1 57 <-- sender MAC - mine

C0 A8 01 FB <-- sender IP - mine = 192.168.1.251

00 00 00 00 00 00 <-- target MAC - unknown, reason for request

C0 A8 01 64 <-- target IP - laptop = 192.168.1.100

00 00 00 00 ..... 00 00 00 <-- trailer of 18 sets of 00 for padding


Side notes that may or may not be important:

  • Both my device and the gateway show up in my laptop's ARP table.
  • My laptop is running Win7.
  • My gateway is a Linksys WRT54GL Wireless-G broadband router.
  • I have analyzed packets via Wireshark to provide the results above.
  • My DHCP block covers X.100 to X.149, so my laptop is assigned X.100 by the router
  • My device IP of X.251 is hard-coded in the device. I see no means of setting a relationship between this IP and my device's MAC in the router config app. All other functions seem to work with my device as a server, so I assume this is not a problem.
  • I have tried sending the ARP request for remote servers (google = 173.194.43.33) both directly to the server's IP and to my gateway's IP (hoping it would realize its need to be a proxy.)
  • I have tried banging my head on the desk, which, sadly, helped a little.

Answer

rekire picture rekire · Sep 14, 2012

If I guess right you post your ARP request to your notebook, which is not permitted to answerthat ARP request. Normally every device answers just for itself. Try to enter the target ip 192.168.1.1 for your router. That should work.

By the way you cannot get the MAC Adress of any devices which are outside of your subnet. Every package needs to send to the gateway mac adress with the target ip adress.