LinuxQuestions.org
Review your favorite Linux distribution.
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 12-14-2005, 04:37 AM   #1
willigiann
Member
 
Registered: Nov 2004
Posts: 46

Rep: Reputation: 15
finding external IP


Hello guys!
i have a router to control my internet connection and i am looking for a way to find the external ip. i know thatyou are going to say to me "whatsmyip.com" but what i really want is a console command that will give me back my ip. do you know how?
 
Old 12-14-2005, 05:19 AM   #2
Sargek
Member
 
Registered: Jan 2003
Location: San Antonio, Texas
Distribution: Debian testing
Posts: 416

Rep: Reputation: 36
The easy way to do this is to look in your router's configuration - it will state what the IP is your ISP is providing.
 
Old 12-14-2005, 06:23 AM   #3
willigiann
Member
 
Registered: Nov 2004
Posts: 46

Original Poster
Rep: Reputation: 15
maybe was my mistake for not clear it. i want my computer to find the outside ip automatically and then send it by e-mail somewhere without me be inside the network.
 
Old 12-14-2005, 07:01 AM   #4
michaelk
Moderator
 
Registered: Aug 2002
Posts: 25,699

Rep: Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895
Have you done any googling?
lynx -dump http://whatismyip.com | awk '/Your/ {print $4}'

FYI you can sign up with one of the free dynamic IP DNS sites like www.noip.com. No need to worry about changing IP addresses.
 
Old 12-14-2005, 04:43 PM   #5
willigiann
Member
 
Registered: Nov 2004
Posts: 46

Original Poster
Rep: Reputation: 15
i tried with lynx but i couldn't make it work. anyway i know that about dyndns services but i have a problem, i have a netgear router which is being hacked all the time and as a result they change me my IP, so when i ping my self i get back an IP something like 192.168.4.200 instead of my real IP. so i need someone "from inside" to tell me the true IP. so this command you gave me will be my insider
 
Old 12-14-2005, 05:01 PM   #6
willigiann
Member
 
Registered: Nov 2004
Posts: 46

Original Poster
Rep: Reputation: 15
what i am going to do is this: lynx -dump http://whatismyip.com | awk '/Your/ {print $4}' > test && mail qwerty@qwerty.qw -q test -s mycurrentip
what i still looking for is about the mail program how am i going to say to the program "send" i found that if you are typing a mail you press ctrl+D but what do you do in such a case?
 
Old 12-14-2005, 06:01 PM   #7
michaelk
Moderator
 
Registered: Aug 2002
Posts: 25,699

Rep: Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895
Sounds like you need to fix the leaks.
Is the router updated with the latest firmware?
What services are you allowing through the router?
Is this a wireless router?
What distribution / version of linux are you running?
Quote:
so when i ping my self i get back an IP something like 192.168.4.200 instead of my real IP
Internal or external ping? router or linux PC?
Have you changed the router's default password?
 
Old 12-15-2005, 03:22 AM   #8
willigiann
Member
 
Registered: Nov 2004
Posts: 46

Original Poster
Rep: Reputation: 15
Is the router updated with the latest firmware?
-The only version i found is this> http://kbserver.netgear.com/release_notes/D102358.asp
What services are you allowing through the router?
-apache 80
-ssh 22
-remote configuration 8080
Is this a wireless router?
-yes, 64bit encoding
What distribution / version of linux are you running?
-SuSE 10 updated
Internal or external ping?
-external
router or linux PC?
-both
Have you changed the router's default password?
-yes, a mix of letters,capitals,numbers,symbols.
 
Old 12-15-2005, 04:51 AM   #9
Hamsjael
Member
 
Registered: Aug 2003
Location: Vejle, Denmark
Distribution: Mainly Debian, some Fedora for the bleeding edge fix
Posts: 92

Rep: Reputation: 15
You Can use traceroute to display the outside of the router, just need to figure out which line displays your external router Interface. Then it should be quite easy to mail the rigth line to yourself.

regards

Brian
 
Old 12-15-2005, 05:13 AM   #10
bruse
Member
 
Registered: Feb 2005
Location: internet
Distribution: Debian
Posts: 821

Rep: Reputation: 30
After some exper. i have found that Just pinging the internal IP address will give u the external IP address.

Pls let me know.?
 
Old 12-15-2005, 05:20 AM   #11
willigiann
Member
 
Registered: Nov 2004
Posts: 46

Original Poster
Rep: Reputation: 15
well first of all i want to thank all of you for your answers, but now there is only one thing i don't know. what shall i write after
Quote:
lynx -dump http://whatismyip.com | awk '/Your/ {print $4}' > test && mail qwerty@qwerty.qw -q test -s mycurrentip
in order to send the e-mail?
 
Old 12-15-2005, 05:27 AM   #12
bruse
Member
 
Registered: Feb 2005
Location: internet
Distribution: Debian
Posts: 821

Rep: Reputation: 30
After some exper. i have found that Just pinging the internal IP address will give u the external IP address.

Pls let me know.?
 
Old 12-15-2005, 07:30 AM   #13
michaelk
Moderator
 
Registered: Aug 2002
Posts: 25,699

Rep: Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895
How about
ip='lynx -dump http://whatismyip.com | awk '/Your/ {print $4}''
mail -s $ip qwerty@qwerty.qw
 
Old 12-15-2005, 11:59 AM   #14
willigiann
Member
 
Registered: Nov 2004
Posts: 46

Original Poster
Rep: Reputation: 15
Quote:
Originally Posted by michaelk
How about
ip='lynx -dump http://whatismyip.com | awk '/Your/ {print $4}''
mail -s $ip qwerty@qwerty.qw
its not working on me, does on you?
billg@server:~> ip="lynx -dump http://whatismyip.com | awk '/Your/ {print $4}'"
billg@server:~> mail -s $ip billg@billg.gr
"mp" is not a user of this system
 
Old 12-15-2005, 01:55 PM   #15
michaelk
Moderator
 
Registered: Aug 2002
Posts: 25,699

Rep: Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895
My fault should of been in a script.
#!/bin/bash
ip='lynx -dump http://whatismyip.com | awk '/Your/ {print $4}''
mail -s $ip qwerty@qwerty.qw

Save the file and change its permissions for executable.
 
  


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
finding out fs basilogics Linux - General 6 07-02-2005 08:44 AM
ld not finding what is there Neruocomp Fedora 1 06-24-2005 10:52 PM
finding something thesnaggle Linux - General 1 10-30-2003 09:05 AM
finding cause ram_dhupkar Linux - Hardware 1 08-11-2003 08:48 AM
What's it finding and who's looking? lynch Linux - General 2 04-14-2002 05:00 PM

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

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