PCLinuxOS-Forums
News: ...FLASH!!! ...New PCLinuxOS Testing board now open. Register today! Be an active contributor to the PCLinuxOS future! ... Read all about it now, on THIS forum!!!..
 
*
Welcome, Guest. Please login or register. May 27, 2012, 11:32:47 AM


Login with username, password and session length


Pages: [1]   Go Down
  Print  
Author Topic: How To Find External IP From Behind A Router  (Read 1182 times)
Archie
Global Moderator
Hero Member
*****
Offline Offline

Posts: 6885


I will never forget you, uhhh...


« on: March 18, 2011, 08:49:30 PM »

If you are behind a router on your home network, and your ISP assigns you a dynamic IP, your machine would probably tell you your IP address is 192.168.1.88.

[user@localhost ~]$ ifconfig eth0
eth0      Link encap:Ethernet  HWaddr 00:1A:80:1B:1D:27
          inet addr:192.168.1.88  Bcast:192.168.1.255  Mask:255.255.255.0
          inet6 addr: ****::***:****:****:****/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:5153411 errors:0 dropped:0 overruns:0 frame:0
          TX packets:22248630 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:4411355917 (4.1 GiB)  TX bytes:3225482953 (3.0 GiB)
          Interrupt:16
[user@localhost ~]


Well, that's not exactly right. Here's what you can do:

[user@localhost ~]$ wget -qO - http://cfaj.freeshell.org/ipaddr.cgi
125.***.***.39
[user@localhost ~]$
Logged

YouCanToo
PCLinuxOS Tester
Hero Member
*******
Offline Offline

Posts: 4251


Location: Lebanon, OR., USA


WWW
« Reply #1 on: March 18, 2011, 10:10:45 PM »

If you are behind a router on your home network, and your ISP assigns you a dynamic IP, your machine would probably tell you your IP address is 192.168.1.88.

[user@localhost ~]$ ifconfig eth0
eth0      Link encap:Ethernet  HWaddr 00:1A:80:1B:1D:27
          inet addr:192.168.1.88  Bcast:192.168.1.255  Mask:255.255.255.0
          inet6 addr: ****::***:****:****:****/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:5153411 errors:0 dropped:0 overruns:0 frame:0
          TX packets:22248630 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:4411355917 (4.1 GiB)  TX bytes:3225482953 (3.0 GiB)
          Interrupt:16
[user@localhost ~]


Well, that's not exactly right. Here's what you can do:

[user@localhost ~]$ wget -qO - http://cfaj.freeshell.org/ipaddr.cgi
125.***.***.39
[user@localhost ~]$



You could just go to http://whatismyip.com and it will actually show you your public ip
Logged





Be sure to visit the NEW Knowledge Base


Linux is user-friendly- it's just picky who its friends are!
Neal ManBear
Administrator
Super Villain
*****
Offline Offline

Posts: 15203


LXDE! Coffee, Bacon and Cheesecake!


« Reply #2 on: March 18, 2011, 10:16:41 PM »

Good to know both ways. Smiley
Logged

Archie
Global Moderator
Hero Member
*****
Offline Offline

Posts: 6885


I will never forget you, uhhh...


« Reply #3 on: March 18, 2011, 11:43:02 PM »

You could just go to http://whatismyip.com and it will actually show you your public ip


A user's browser pointing to http://whatismyip.com is certainly one of the few ways of doing it. Just as a user can easily type in a simple command on the terminal would accomplish the same thing. Freedom and choices.
Logged

AndrzejL
PCLinuxOS Tester
Super Villain
*******
Offline Offline

Posts: 11990


Registered Linux User #490933


WWW
« Reply #4 on: March 19, 2011, 05:11:40 AM »

I wrote this while back:

Quote
#!/bin/sh
external_ip=`curl http://www.whatismyip.com/faq/automation.asp`
echo "My IP address is: "$external_ip
echo "End!"

Regards.

Andy
Logged

Neal ManBear
Administrator
Super Villain
*****
Offline Offline

Posts: 15203


LXDE! Coffee, Bacon and Cheesecake!


« Reply #5 on: March 19, 2011, 05:12:15 AM »

......... Freedom and choices.

A big +1! Smiley
Logged

Old-Polack
Administrator
Hero Member
*****
Offline Offline

Posts: 9695


----IOFLU----


« Reply #6 on: March 19, 2011, 06:20:32 AM »

I use:

----------------------------------------------------------------
#!/bin/bash
# Name: myip
# Author: O-P
# Purpose: Check current public IP address

curl -s checkip.dyndns.org|sed -e 's/.*Current IP Address: //' -e 's/<.*$//'


-----------------------------------------------------------------

This is in ~/bin so it's in my $PATH. I type myip at a prompt, press the Enter key, and the number is displayed.
Logged

Old-Polack

Of what use be there for joy, if not for the sharing thereof?



Lest we forget...
Was_Just19
Hero Member
*****
Offline Offline

Posts: 6885


MLU


« Reply #7 on: March 19, 2011, 09:06:41 AM »

Some locations for checking IP addresses in addition to the command line methods

checkip.dnydns.org
www.showmyip.com
showip.net
www.displaymyip.com
Logged
menotu
PCLinuxOS Tester
Super Villain
*******
Offline Offline

Posts: 11990

┌∩┐(◕_◕)┌∩┐


« Reply #8 on: March 19, 2011, 09:26:49 AM »

Good to know both ways. Smiley


+1
Logged

If you can keep you head while all around you are losing theirs, then you have misunderstood the situation.

PCLinuxOS 32bit & 64bit; 3.2.17bfs kernel, KDE 4.8.3; nvidia 295.53, Athlon 64 X2 4200+; 4GB Ram; NVidia GeForce 8400GS 1GB; x.org 1.10.4 ; 500GB/320GB
Jonesy
Sr. Member
****
Offline Offline

Posts: 261


« Reply #9 on: September 09, 2011, 05:28:19 PM »

I wrote this while back:

Quote
#!/bin/sh
external_ip=`curl http://www.whatismyip.com/automation/n09230945.asp`
echo "My IP address is: "$external_ip
echo "End!"

Regards.

Andy


That URL is now defunct, the script should now read:

Code:
#!/bin/sh
external_ip=`curl http://automation.whatismyip.com/n09230945.asp`
clear
echo "My IP address is: "$external_ip
echo "End!"

I added clear so as to remove the extraneous data and just print the required info.

Rgds  Wink
Logged

"But it was ok before.... honest"
darkages
Sr. Member
****
Offline Offline

Posts: 263


Windows? Naah. Now, clowns… that's another story.


« Reply #10 on: September 09, 2011, 06:31:54 PM »

My IP.sh
Code:
clear
echo "Your Public IP is:"
wget http://checkip.dyndns.org/ -q -O - | grep -Eo '\<[[:digit:]]{1,3}(\.[[:digit:]]{1,3}){3}\>'
 
Logged

The clowns? Oh, yeah, the clowns. We fight them too; entire armies, spilling out of Volkswagens. We do our best to fight them off, but they keep sending `em in.
maxpolaris
Full Member
***
Offline Offline

Posts: 95



« Reply #11 on: December 05, 2011, 04:53:21 AM »

I love these little snippets for command line. I like to copy them into txt files so I can toy with them.
Logged

cirrus_minor
Full Member
***
Offline Offline

Posts: 123


☆★ #watp ★☆


WWW
« Reply #12 on: December 05, 2011, 05:01:09 AM »

you can also visit my page at http://cirrusminor.info  and the lil danasoft widgit will show ur browser/OS/IP  Tongue  .>PLUG<. Tongue
Logged



$ PCLOS~KDE~ 2011.Kernel:2.6.38.8
CPU:Intel® Pentium D 2x3.GHz
GPU:ASUS® [G92 EN8800 GT TOP] 512MB DDR3.
Memory:3072MB'DDR2 | HDD Size 1TB
Audio:Audigy2 ZS 7.1
DeBaas
Hero Member
*****
Offline Offline

Posts: 1054



WWW
« Reply #13 on: December 05, 2011, 05:02:32 AM »

http://test-ipv6.com/

Is showing my ipv4 and ipv6 addresses on the net.
Logged

Pages: [1]   Go Up
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.16 | SMF © 2011, Simple Machines

Valid XHTML 1.0! Valid CSS! Dilber MC Theme by HarzeM