IP Address

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi All,

How do I get the source IP of a packet, not knowing if NAT has taken place.

Thanks In Advance
 
Hello, MMA!

Socket.RemoteEndpoint gives the source address of the received packet.

You wrote on Fri, 20 Oct 2006 06:31:02 -0700:

M> How do I get the source IP of a packet, not knowing if NAT has taken
M> place.

M> Thanks In Advance
 
Hi,

But won't RemoteEndpoint only give the address of a router and not the LAN IP
of the source machine? (which I suspect MMA is after)

If I'm correct, then maybe knowing why you want the source IP would be useful.
You might get a more appropriate response if you let us know.
 
Hello, Dave!

DS> But won't RemoteEndpoint only give the address of a router and not
DS> the LAN IP
DS> of the source machine? (which I suspect MMA is after)

AFAIK no. When you're connecting to the remote host, you do not
know if there is any router out there ( or if there is route to this
machine ).

you can open microsoft.com, and then use "netstat -an -p tcp" command,
you'll observe that you're connected to MS endpoint and not the router.

DS> If I'm correct, then maybe knowing why you want the source IP would
DS> be useful.
DS> You might get a more appropriate response if you let us know.

DS> --
DS> Dave Sexton

 
Hi Vadym,

I wasn't clear in my response. I was referring to a "remote" router, not
local NAT.

I believe I just took the OP's question too literally. I guess "NAT" means
"local NAT" in the OP :)

Thanks for the reply.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top