LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
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 04-25-2004, 08:53 PM   #1
Davno
Member
 
Registered: Mar 2004
Location: Montreal, Canada
Distribution: Linux MX 23 KDE "Libretto"
Posts: 213

Rep: Reputation: 25
silly question: howto find Wan ip


How to find my Wan IP in a shell (konsole), ifconfig shows only my Lan ip, and my router firmware use some html that dont show well in my browser.
Thxs
 
Old 04-25-2004, 09:36 PM   #2
DrOzz
Senior Member
 
Registered: May 2003
Location: Sydney, Nova Scotia, Canada
Distribution: slackware
Posts: 4,185

Rep: Reputation: 60
i personally can't think of a way doing that from command line, but you
can always go to www.whatismyipaddress.com ...
 
Old 04-25-2004, 11:27 PM   #3
Robert0380
LQ Guru
 
Registered: Apr 2002
Location: Atlanta
Distribution: Gentoo
Posts: 1,280

Rep: Reputation: 47
here is a sexy lil shell script i wrote (re-wrote...) it uses lynx and whatismyip.com

Code:
#!/bin/bash
                                                                                
lynx -dump http://whatismyip.com | awk '/Your/ {print $4}'
drop that in a file called getip chmod u+x it, and drop it in /usr/local/bin

example:
Code:
robert@decatur robert $ getip
68.xxx.4.xxx
robert@decatur robert $
i just put the x's in to blot out my IP.
 
Old 04-25-2004, 11:29 PM   #4
Robert0380
LQ Guru
 
Registered: Apr 2002
Location: Atlanta
Distribution: Gentoo
Posts: 1,280

Rep: Reputation: 47
oh, make sure /usr/local/bin is in your $PATH
 
Old 04-26-2004, 01:14 AM   #5
bulliver
Senior Member
 
Registered: Nov 2002
Location: Edmonton AB, Canada
Distribution: Gentoo x86_64; Gentoo PPC; FreeBSD; OS X 10.9.4
Posts: 3,760
Blog Entries: 4

Rep: Reputation: 78
Robert0380: That's a sweet little one liner. Thanks.
I'm gonna make it a shell alias.

Last edited by bulliver; 04-26-2004 at 01:20 AM.
 
  


Reply



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
Find WAN ip from behind router Rizla Linux - Networking 7 05-27-2005 04:19 AM
FreeS/Wan Vs. OpenS/Wan Vs. StrongS/Wan bkankur Linux - Security 1 03-01-2005 09:27 AM
Silly Question koodoo Linux - Newbie 2 02-14-2005 07:20 AM
Silly Question Crashed_Again Linux - General 21 04-07-2003 05:08 AM
another silly question. rivethead Linux - Software 2 03-01-2003 03:05 AM

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

All times are GMT -5. The time now is 05:40 PM.

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