IP Address

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • MMA

    #1

    IP Address

    Hi All,

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

    Thanks In Advance

  • Vadym Stetsyak

    #2
    Re: IP Address

    Hello, MMA!

    Socket.RemoteEn dpoint gives the source address of the received packet.

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

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

    MThanks In Advance


    --
    With best regards, Vadym Stetsyak.
    Blog: http://vadmyst.blogspot.com


    Comment

    • Dave Sexton

      #3
      Re: IP Address

      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.

      --
      Dave Sexton

      "Vadym Stetsyak" <vadym_s@ukr.ne twrote in message
      news:uRinqcI9GH A.5092@TK2MSFTN GP04.phx.gbl...
      Hello, MMA!
      >
      Socket.RemoteEn dpoint gives the source address of the received packet.
      >
      You wrote on Fri, 20 Oct 2006 06:31:02 -0700:
      >
      MHow do I get the source IP of a packet, not knowing if NAT has taken
      Mplace.
      >
      MThanks In Advance
      >
      >
      --
      With best regards, Vadym Stetsyak.
      Blog: http://vadmyst.blogspot.com
      >

      Comment

      • Vadym Stetsyak

        #4
        Re: IP Address

        Hello, Dave!

        DSBut won't RemoteEndpoint only give the address of a router and not
        DSthe LAN IP
        DSof 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.

        DSIf I'm correct, then maybe knowing why you want the source IP would
        DSbe useful.
        DSYou might get a more appropriate response if you let us know.

        DS--
        DSDave Sexton

        DS"Vadym Stetsyak" <vadym_s@ukr.ne twrote in message
        DSnews:uRinqcI9 GHA.5092@TK2MSF TNGP04.phx.gbl. ..
        >Hello, MMA!
        >Socket.RemoteE ndpoint gives the source address of the received packet.
        >You wrote on Fri, 20 Oct 2006 06:31:02 -0700:
        >MHow do I get the source IP of a packet, not knowing if NAT has
        >taken
        >Mplace.
        >MThanks In Advance
        --
        With best regards, Vadym Stetsyak.
        Blog: http://vadmyst.blogspot.com


        Comment

        • Dave Sexton

          #5
          Re: IP Address

          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.

          --
          Dave Sexton

          "Vadym Stetsyak" <vadym_s@ukr.ne twrote in message
          news:ukKj5nS9GH A.568@TK2MSFTNG P05.phx.gbl...
          Hello, Dave!
          >
          DSBut won't RemoteEndpoint only give the address of a router and not
          DSthe LAN IP
          DSof 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.
          >
          DSIf I'm correct, then maybe knowing why you want the source IP would
          DSbe useful.
          DSYou might get a more appropriate response if you let us know.
          >
          DS--
          DSDave Sexton
          >
          DS"Vadym Stetsyak" <vadym_s@ukr.ne twrote in message
          DSnews:uRinqcI9 GHA.5092@TK2MSF TNGP04.phx.gbl. ..
          >>Hello, MMA!
          >
          >>Socket.Remote Endpoint gives the source address of the received packet.
          >
          >>You wrote on Fri, 20 Oct 2006 06:31:02 -0700:
          >
          >>MHow do I get the source IP of a packet, not knowing if NAT has
          >>taken
          >>Mplace.
          >
          >>MThanks In Advance
          >
          --
          With best regards, Vadym Stetsyak.
          Blog: http://vadmyst.blogspot.com
          >

          Comment

          Working...