Using pcap_sendpacket
in C, I'm manually sending the following packet on wlan0
(I've left out some fields, but I think they are correct):
(Ethernet layer)
eth src: <wlan0 MAC address>
eth dest: <wireless router MAC address>
(ARP request layer)
opcode: 1 (Request)
sender_hw: <wlan0 MAC address>
sender_proto: 192.168.1.3 (IP of wlan0)
target_hw: 0 (per usual)
target_proto: 173.194.46.72 (Google.com)
Using Wireshark to listen on wlan0
, I expect to see an ARP reply giving me the MAC address of a Google server. However, I am not seeing any ARP replies containing Google's IP whatsoever.
One thing to note is that I am building this packet by intercepting an ARP request sent to a virtual network interface (the packet is generated when I use the ping
command from within the virtual netspace), then rewriting the packet and injecting it on wlan0
using pcap
, so that I can later get the ARP reply and forward it back to the virtual network. This is why I am relatively confident that the other fields in the packet are correct, since I really didn't modify them.
Does anyone know what might be the problem here? One thing I'm sort of noticing is that I don't have my router's IP address (192.168.1.1) anywhere in that packet; not really sure whether I need that or not.