Solved

client side ip

Posted on 2014-04-11
7
316 Views
Last Modified: 2014-04-14
is there any way to get client's internal ip address via jscript like 192.168.1.27
0
Comment
Question by:F4SX
7 Comments
 
LVL 52

Expert Comment

by:Scott Fell, EE MVE
ID: 39993678
Using client side scripting like javasctipt/jquery or server side script like .NET or PHP the answer is no. The browser by nature can't give you any local information or it would be a security issue.  

You would probably have to use a java applet to do this.  

I currently use an applet to access a local printer programatically so I am sure the same can be done to get the local IP.  You just have some security issues to work through in addition to your programming that will include using a certificate for the app.  http://docs.oracle.com/javase/tutorial/deployment/applet/security.html

I am not a java dev but I did find this http://www.mkyong.com/applet/how-to-get-client-ip-address-in-applet/.  Let's add java to your question topic and see if we can bring in some java Devs.
0
 
LVL 12

Accepted Solution

by:
jitendra patil earned 500 total points
ID: 39993746
you can try the below jquery stuff
<script type="text/javascript" src="Scripts/jquery-1.6.2.js"></script>

 <script type="text/javascript">

     $.getJSON("http://jsonip.appspot.com?callback=?",

    function (data) {

        alert("Your ip: " + data.ip);

    });

 </script>

OR
<script type="text/Javascript">
function getip()
{
alert('your ip adresse is : ".$_SERVER['REMOTE_ADDR']."');
}
</script>

<body onload="javascript:getip()">

</body>

Open in new window

hope this helps.
0
 
LVL 52

Expert Comment

by:Scott Fell, EE MVE
ID: 39993769
jitendra patil, he can get your outside IP already.   I think he is looking for the internal IP.
0
Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

 
LVL 86

Expert Comment

by:CEHJ
ID: 39994197
What would you want to do with it? It's generally useless unless you're on the same LAN
0
 

Author Comment

by:F4SX
ID: 39996699
I have a project which has a VPN server with serving ip addresses

10.0.0.0/24

and there are 50 router + 1 web server web server ip is 10.0.0.2 and other 50 router give ip address to each client like
192.168.1.0/24

i want to know whcih client get the which ip address and where he come from
0
 

Author Closing Comment

by:F4SX
ID: 40000833
thanks
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

This article discusses how to create an extensible mechanism for linked drop downs.
Finding original email is quite difficult due to their duplicates. From this article, you will come to know why multiple duplicates of same emails appear and how to delete duplicate emails from Outlook securely and instantly while vital emails remai…
In this tutorial viewers will learn how to embed videos in a webpage using HTML5. Ensure your DOCTYPE declaration is set to HTML5: "<!DOCTYPE html>": Use the <video> tag to insert a video. Define the src as the URL of your video; this is similar to …
The viewer will the learn the benefit of plain text editors and code an HTML5 based template for use in further tutorials.

856 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question