Archie
Global Moderator
Hero Member
   
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
|
 |
« 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 BaseLinux is user-friendly- it's just picky who its friends are!
|
|
|
|
|
Archie
Global Moderator
Hero Member
   
Offline
Posts: 6885
I will never forget you, uhhh...
|
 |
« Reply #3 on: March 18, 2011, 11:43:02 PM » |
|
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
|
 |
« Reply #4 on: March 19, 2011, 05:11:40 AM » |
|
I wrote this while back: Regards. Andy
|
|
|
|
|
Logged
|
|
|
|
Neal ManBear
Administrator
Super Villain
   
Offline
Posts: 15203
LXDE! Coffee, Bacon and Cheesecake!
|
 |
« Reply #5 on: March 19, 2011, 05:12:15 AM » |
|
......... Freedom and choices.
A big +1! 
|
|
|
|
|
Logged
|
|
|
|
Old-Polack
Administrator
Hero Member
   
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... 
|
|
|
|
|
|
menotu
|
 |
« Reply #8 on: March 19, 2011, 09:26:49 AM » |
|
Good to know both ways.  +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
|
 |
« Reply #9 on: September 09, 2011, 05:28:19 PM » |
|
I wrote this while back: Regards. Andy That URL is now defunct, the script should now read: #!/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 
|
|
|
|
|
Logged
|
"But it was ok before.... honest"
|
|
|
|
darkages
|
 |
« Reply #10 on: September 09, 2011, 06:31:54 PM » |
|
My IP.sh 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
|
 |
« 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
|
 |
« 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  .>PLUG<. 
|
|
|
|
|
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
|
|
|
|
|
|