How do I get a public IP address of a mobile phone?
Asked Answered
S

4

6

I want to connect my phone to a server using the internet using the server's IP address. Mobile phone's IP address are normally private as far as I came to know.. To make my app work, I need a public IP address of my phone. How do I achieve that?

Simla answered 8/12, 2010 at 8:15 Comment(2)
how do you connect your mobile to internet?Tragedienne
Well, you said it yourself - mobile phones have private IPs, NATted at the carrier. Getting the "public" IP inasmuch as there is such a thing will give you an address of a box that doesn't help you. You won't be able to connect back to the phone, in any caseHopson
F
13

You'll have to wait for IPv6 ;) Now you get private address and the your service provider does some address translation (NAT): The router has one single public IP and uses ports to map incoming messages to IP addresses of the private network.

Your mobile's IP is invisible to the internet and the networks public IP is useless, because it is the router's address. Maybe with IPv6 we have public IPs for all mobiles, but for now you'll have to find a different solution for your problem - public IP doesn't work with mobiles as with all other clients in private networks (behind routers).

Fp answered 8/12, 2010 at 8:55 Comment(1)
This is the major reason why surveillance is so simple. We are not able to use our devices to interact directly in the Internet. Instead we need to use an interaction provider like WA or FB or YT. If NAT would not exist, we were free to interact without surveillance.Hames
V
2

Setup your own hosting server, make your app "goto" that server, fetch a simple txt page, in that simple txt you dynamically on the server set the address that was used to get the txt.

Example:

Server: yourexample.com url for /ip.php ip.php just respondes with mimetype text and the address of the requesting client.

J2ME: Request yourexample/ip.php in the repsonse is the address of your app.

Vento answered 8/12, 2010 at 9:8 Comment(1)
I have my own server.. It's in my computer and I want my mob to access it via its IP.. When I send a request,it goes to that server via a socket and after the server has processed the results,sends it back to the client ...That's the architecture of my app..I was wondering if that;s possible..Simla
H
1

astonishingly - t-mobile 3g service seems to assign a public IP. I'm still looking into the details, but I've seen an internet-available website running on a tethered laptop

Hydrotherapy answered 30/12, 2010 at 21:4 Comment(0)
M
1

You should get your i/p address. Open your browser and enter http://whatismyipaddress.com/ or wait till you have You'll have to wait for IPv6

Mingo answered 17/1, 2014 at 11:42 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.