Expiring Today—Celebrate National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

client side ip

Posted on 2014-04-11
7
Medium Priority
?
328 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
7 Comments
 
LVL 53

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 13

Accepted Solution

by:
Jitendra Patil earned 2000 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 53

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
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
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

On Demand Webinar - Networking for the Cloud Era

This webinar discusses:
-Common barriers companies experience when moving to the cloud
-How SD-WAN changes the way we look at networks
-Best practices customers should employ moving forward with cloud migration
-What happens behind the scenes of SteelConnect’s one-click button

Question has a verified solution.

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

The article shows the basic steps of integrating an HTML theme template into an ASP.NET MVC project
When crafting your “Why Us” page, there are a plethora of pitfalls to avoid. Follow these five tips, and you’ll be well on your way to creating an effective page.
This theoretical tutorial explains exceptions, reasons for exceptions, different categories of exception and exception hierarchy.
Viewers will learn how to properly install Eclipse with the necessary JDK, and will take a look at an introductory Java program. Download Eclipse installation zip file: Extract files from zip file: Download and install JDK 8: Open Eclipse and …
Suggested Courses

719 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