Problem
I encountered the same problem today, where martian packets flooded my kernel logs. All the martian packets are from the same public IP address of eth0 to the same public IP address of eth0 (the real IPs and header is removed).
IPv4: martian source x.x.x.x from x.x.x.x, on dev eth0
ll header: 00000000: aa bb cc dd ee ff gg hh ii jj kk ll 08 00
After some research, I realized the reason is hidden in the ll header of the martian packets.
Theory
Assuming this in a Ethernet connection, ll header actually shows the beginning part of a Ethernet Type II Frame, which contains the destination MAC address, source MAC address, and a ID indicates the type of the rest part of the packet.
![Ethernet Type II Frame Format[1]](https://i.stack.imgur.com/ZUrzv.png)
As you see, the first 6 bytes are the destination MAC address, the next 6 bytes are the source MAC address, and a code in last 2 bytes. Common codes are:
08 00: IP Packets
86 dd: IPv6 Packet
08 06: ARP Packet
Explanation
Back to my example.
IPv4: martian source x.x.x.x from x.x.x.x, on dev eth0
ll header: 00000000: aa bb cc dd ee ff gg hh ii jj kk ll 08 00
This tells us,
- there was a packet received with the SAME source and destination IP address.
- It was sent by
GG:HH:II:JJ:KK:LL, which is a MAC address I don't know.
- Its destination is
AA:BB:CC:DD:EE:FF, which is my own MAC address.
- It was an IP packet (
08 00).
If a packet has the same source and destination IP addresses, it must be sent by the same network interface, but the MACs for source and destination are different! How can it be possible?
Thus, it is clear that the packet comes from Mars, either there are some routing problems, a machine within the network is configured, or someone is trying to spoof the IP/MAC addresses. The next step is checking the source MAC address in question.