How does a masqueraded ping packet return?

I'm using IP masquerading to allow access to the net for my private network.

I was wondering since masquerading is done only on TCP/UDP packets, how did the response to my pings come back to the private network?

Moreover, ICMP packets don't specify source ports which is required for masquerading.
Who is Participating?
j2Connect With a Mentor Commented:
the packet handler in the Linux keeps track of the packet serial numbers, and rewrites the packages as they are sent / received. Just as long as ICMP masquerading is enabled in kernel / modules.

Portnumber is not required for masquerading, only for TCP. ICMP can be masqueraded, or atleast 'faked' as long as the masquerading host has the proper code to handle it all.
vincesimAuthor Commented:
Thanx for the response. Know of anywhere I can find out more about how ICMP gets masqueraded? Like man pages or any other web resource?
I would suggest the sourcecode for the masquerading parts of the kernel.. Never seen any "howto" on the technical side.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.