Currently working on a Go based NAT router and when translating ICMP traffic and am seeing some interesting behavior.
The clients request is forwarded to the server, the server keeps track of the internal IP and the clients ICMP ID, uses an open ICMP ID from the server, changes fields in the packet and forwards it to the external address (in this case 8.8.8.8).
When the server receives the response it looks up what internal IP, MAC, and ICMP ID to the external ICMP packet ID and forwards it back to the client.
I am likely missing something basic because I am too close to the issue but any help would be appreciated. If the packet is malformed in some way that I have not recognized then I will be able to adjust the code accordingly.
Reply Sent from server after receiving outside reply