LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 08-04-2011, 09:43 AM   #16
Skaperen
Senior Member
 
Registered: May 2009
Location: center of singularity
Distribution: Xubuntu, Ubuntu, Slackware, Amazon Linux, OpenBSD, LFS (on Sparc_32 and i386)
Posts: 2,900
Blog Entries: 31

Rep: Reputation: 181Reputation: 181

I think it is amazing how complicated some people can make a simple problem with a simple solution.

FYI, I tried whatismyip.org with wget command shown for icanhazip.com. The difference is with icanhazip.com there was a newline after the IP, whereas with whatismyip.org there was not (that's the way the respective servers send it). Either should work fine in a script capture.
 
Old 02-28-2012, 09:09 AM   #17
Mikhus
LQ Newbie
 
Registered: Feb 2012
Posts: 2

Rep: Reputation: Disabled
Here is another one:

curl smart-ip.net/myip

Also works fine with IPv6!

Last edited by Mikhus; 02-28-2012 at 12:39 PM.
 
Old 02-28-2012, 10:10 AM   #18
redir
Member
 
Registered: May 2004
Location: Virginia USA
Distribution: Debian_Ubuntu_FreeBSD
Posts: 122

Rep: Reputation: 16
Quote:
Originally Posted by Skaperen View Post
I think it is amazing how complicated some people can make a simple problem with a simple solution.

FYI, I tried whatismyip.org with wget command shown for icanhazip.com. The difference is with icanhazip.com there was a newline after the IP, whereas with whatismyip.org there was not (that's the way the respective servers send it). Either should work fine in a script capture.
Sometimes less is more, sometimes more is less. I am the king of all make simple things difficult. BUt it's great way to learn
 
Old 04-01-2012, 04:00 PM   #19
orko
Member
 
Registered: Nov 2003
Location: Chittagong, Bangladesh
Distribution: RHEL 5
Posts: 63

Rep: Reputation: 19
when the router is forced to use a proxy (transparent proxy) all of the suggested command/script is showing the proxy address . not the router's external ip address.
 
Old 04-13-2012, 05:32 PM   #20
JohnBola
LQ Newbie
 
Registered: Apr 2012
Posts: 1

Rep: Reputation: Disabled
Here's another one: ipecho.net

I like this one because it provides a plain version as well, for programming. You can use that one from the command line like this:

wget -qO- ipecho.net/plain

Hope this helps
 
Old 07-18-2012, 07:30 AM   #21
mohansuppu
LQ Newbie
 
Registered: Jul 2012
Posts: 1

Rep: Reputation: Disabled
wget -O - -q icanhazip.com

Thank you so much, its working for me too.
 
Old 08-02-2012, 06:18 AM   #22
fthynne
LQ Newbie
 
Registered: Apr 2010
Posts: 9

Rep: Reputation: 1
Most of the postings on this thread rely on one or another third party service which may not format its response in a uniform way, may not take kindly to frequent querying or may not exist indefinitely.

For example, curl whatismyip.org may have worked in the past, but it doesn't now. Visiting whatismyip.org with a web browser produces a nice clear visible result, but it uses client-side javascript which neither curl nor wget interpret.

Most other web pages produce a clear result without client-side scripting, but usually produce text that has to be parsed to produce just the IP address to use, say, in a script.

If you have a web site, you could consider creating a PHP page containing just
<? echo $_SERVER["REMOTE_ADDR"]."\n"; ?>

curl http://your-site/showip.php would then produce just what you need. However, there's a slight risk your site might be overwhelmed if everyone discovered and used it! To avoid that, you'd need to interrogate your router instead. This isn't quite so easy as it depends on your router's manufacturer and model, and I haven't found a good thread for that.
 
Old 09-06-2012, 10:35 PM   #23
gnrsu
LQ Newbie
 
Registered: Jul 2012
Posts: 2

Rep: Reputation: 0
Thumbs up

in deed, i do not know which OS you are using, but if you just want to find your real wan or lan ip addresses, you can try the IP2:

appnee.com/ip2/
 
Old 01-25-2013, 05:35 AM   #24
linuss
LQ Newbie
 
Registered: Jan 2013
Posts: 2

Rep: Reputation: 0
Quote:
Originally Posted by Moses420ca View Post
Hi.
I behind a NAT enabled router and I need to find my external IP address for logging purposes. What I want is a command line tool that looks like this.

Code:
getip >> iplog.log
Thanks for any help. Drew
hi,

There are so many ways available to find an external ip address. A simple way to find your external ip address visit the site Ip-details.com. To implement this url you can get the external ip address via code.

Try the code below to obtain your ip address:

cd -
mkdir bin
nano bin/ip-details.sh Then run the command using the code chmod u+x bin/url.sh to get your external ip address.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
public ip address from behind nat mrtwice Linux - Networking 4 09-13-2012 09:24 AM
Problem Configuring Address Restricted Nat cipherscrux Linux - Networking 1 06-22-2006 01:52 AM
blocking mac address and NAT com90185 Linux - Security 6 03-07-2005 06:37 PM
How to detect IP address via NAT server jerrytw Linux - Networking 7 11-08-2004 04:42 AM
how to use my Ip address if having a NAT router poeta_boy Linux - Networking 5 04-17-2004 06:10 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 12:31 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration