LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
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 06-18-2008, 11:15 AM   #1
I_like_TUX
Member
 
Registered: Sep 2007
Distribution: Fedora 7, Edubuntu
Posts: 35

Rep: Reputation: 15
How to get external IP of the router?


Hi! My friend and me is working on the same project and he needs to logon to my machine to work together on the same set of files. However, I have a dynamic IP, I would like to know how can I get the external IP of the router from the command line (I want to write a shell script) so that I can automatically send that IP to him periodically? Thanks.
 
Old 06-18-2008, 11:19 AM   #2
forrestt
Senior Member
 
Registered: Mar 2004
Location: Cary, NC, USA
Distribution: Fedora, Kubuntu, RedHat, CentOS, SuSe
Posts: 1,288

Rep: Reputation: 99
Try this link:

http://whatismyip.com/automation/n09230945.asp

HTH

Forrest
 
Old 06-18-2008, 11:20 AM   #3
Pearlseattle
Member
 
Registered: Aug 2007
Location: Zurich, Switzerland
Distribution: Gentoo
Posts: 999

Rep: Reputation: 142Reputation: 142
Here:
http://www.linuxquestions.org/questi...ghlight=router
 
Old 06-18-2008, 11:32 AM   #4
forrestt
Senior Member
 
Registered: Mar 2004
Location: Cary, NC, USA
Distribution: Fedora, Kubuntu, RedHat, CentOS, SuSe
Posts: 1,288

Rep: Reputation: 99
The people hosting whatismyip.com don't want automated tools hitting their front page. They have therefore set up the link above.

An alternate way from what is listed in the script in the thread posted by Pearlseattle is (note, you can replace "wget -q -O" with "lynx -dump". I just don't have links installed on the box I'm currently on):

Code:
#!/bin/sh

MYIP=`wget -q -O - http://whatismyip.com/automation/n09230945.asp`
echo $MYIP
HTH

Forrest

Last edited by forrestt; 06-18-2008 at 11:33 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
How do I get external IP address of router... The_JinJ Linux - Networking 2 02-05-2005 07:43 AM
vsftpd, router and external access; Oh my! Imyrryr Linux - Networking 14 09-07-2003 09:22 AM
Firewall between router and external switch is it possible? mylesridgely Linux - Networking 3 08-08-2003 08:33 PM
DSL router with non static external ip raven Linux - Networking 4 03-18-2003 07:16 AM
2 NICs, 2 external IP's (1 behind a router) yskwong Linux - Networking 5 05-25-2001 07:22 AM

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

All times are GMT -5. The time now is 10:56 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