Query Regarding IP address

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • onlymukti4u
    New Member
    • Mar 2007
    • 50

    Query Regarding IP address

    Hi,

    Can anyone help me out in finding internal IP tracking code in ASP?

    Generally we are using Request.ServerV ariables("REMOT E_ADDR") to get remote IP but I want to know how we can get the internal IP address.

    Hoping for a quick and positive response I remain.

    Regards,
    Mukti
    "I am not the best but am not like the rest"
  • JamieHowarth0
    Recognized Expert Contributor
    • May 2007
    • 537

    #2
    Hi there,

    Do you mean when users are on an internal network that is connected to the Internet, how do you get their internal network IP address? If so, you shouldn't need it (and as a server administrator, no disrespect to your need but I don't want my internal IP patterns figured out by some third-party webmaster!).

    However, you can get the web server's internal IP by using [code=asp]<% Request.ServerV ariables("LOCAL _ADDR") %>[/code]. If you need just the public IP of a network then use [code=asp]<% Request.ServerV ariables("REMOT E_ADDR") %>[/code].

    As far as I am aware there is no method of obtaining a non-public IP address using ASP but I would advise checking [code=asp]<% Request.ServerV ariables("ALL_R AW") %>[/code] and seeing if you can see a non-public IP that a public routing device will then use to route any server responses back to the internal network client.

    Hope it helps.

    medicineworker
    Last edited by JamieHowarth0; Oct 18 '07, 09:07 AM. Reason: Addenum to check additional headers

    Comment

    • onlymukti4u
      New Member
      • Mar 2007
      • 50

      #3
      Thanks for your response,but what I exactly want is in an intranet there will be different IP addresses, for example 10.10.10.1,10.1 0.10.2,10.10.10 .3,etc....I want to track those IPs.

      I tried with giving Local_ADDR but its showing the local IP and its showing same in all system.and ALL_ROW also not showing what actual I want.Can you help me out in this regards.

      If you can open the below link there its showing the Current IP address ,I want to track this type of IP for our own intranet but I want the ASP code and its in java and code also not there.

      http://www.auditmypc.c om/whats-my-ip.asp

      Hoping for a quick reply I remain.

      Thanks in advance.

      Regards,
      Mukti

      Comment

      • jhardman
        Recognized Expert Specialist
        • Jan 2007
        • 3405

        #4
        Mukti,

        I think all of the information you have available is in the server variables, unless you use javascript or ajax to get additional info from the user and send it to the server. You could search all of the server variables separately (code follows) but this actually doesn't give you any more information than the "all_raw" that medicineworker already suggested: [code=asp]for each x in request.serverV ariables
        response.write x & ": " & request.serverV ariables(x) & "<br>" & vbNewLine
        next[/code]Jared

        Comment

        • JamieHowarth0
          Recognized Expert Contributor
          • May 2007
          • 537

          #5
          Mukti,

          If the website is only accessible on an internal intranet then the user's internal IP will pop up in Request.ServerV ariables("REMOT E_ADDR").
          If the user is connecting to the network using a VPN and still only accessing the site using the internal DNS address then their VPN internal IP will come up under REMOTE_ADDR.

          So I'm slightly confused as to what your precise requirements are? If you can clarify then it would be much appreciated.

          medicineworker

          Comment

          • onlymukti4u
            New Member
            • Mar 2007
            • 50

            #6
            Sorry to disturb you again and again but what exactly I want is when you will type ipconfig in your commandprompt,y ou can able to see the IP Address and default gateway. I want to know how we can track that IP Address.

            You can see, that IP Address is different from your local IP Address.As we generally assign different IP's for different systems for the systems in Intranet.


            Can you help me out?

            Thanks in advance.

            Regards,
            Mukti

            Comment

            • JamieHowarth0
              Recognized Expert Contributor
              • May 2007
              • 537

              #7
              Hi Mukti,

              When you run IPCONFIG it brings up the IP addresses for your PC's network adapters.
              If your PC is on an internal network that is connected to the Internet through a gateway (router/firewall/ADSL modem etc.) then it still comes up with the internal IP not the public (modem's) IP.

              The main question is: is this website that you are developing only run inside the PC network or is it accessible on the Internet?

              The reason I say this is because if you are running your own web server with the address blahblahtest.co m and it is accessible to the whole Internet, then any of your internal network machines will have the page request routed out to your ISP to lookup the domain, then back into your network to your web server, so you will only see your own router IP when people inside the network access the website.

              The way to run this is you need to run two websites separated by host header values - one to serve the Internet, and one to serve the intranet (assuming you are running an Active Directory domain internally?). You then specify in the website properties host headers - "www.blahblahte st.com" for your Internet-facing site and "internal.blahb lahtest.int" for your intranet-facing site.

              medicineworker

              Comment

              Working...