LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
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
 
LinkBack Search this Thread
Old 11-20-2003, 02:26 PM   #1
mrtwice
Member
 
Registered: Feb 2002
Distribution: xubuntu 8.10
Posts: 225

Rep: Reputation: 31
public ip address from behind nat


I have a linux machine set up on my home network behind a dsl router that is NATing my dsl connection. I currently have my router configured to send port 22 to my linux box which is set up with ssh.

Heres the catch, I am not willing to shell out $15 for a static IP address and every now and then the ip address changes on my dsl connection. I want to track what public ip address I have. I plan on writing a script to:

Find out what my public ip address is*
create a text file with that public ip address in it
upload that test file to a ftp service that I can access

*this is what I need help with. I am not sure what the best way to find it would be. In know I can go to http://checkip.dyndns.org/ and it will give it to me and I can parse it out. However, I am figuring that to be a lot of trouble. Is there a better way to do it?

Thanks.
 
Old 11-20-2003, 03:04 PM   #2
JordanH
Member
 
Registered: Oct 2003
Location: Toronto, Canada
Distribution: Ubuntu, FC3, RHEL 3-4 AS Retired: SuSE 9.1 Pro, RedHat 6-9, FC1-2
Posts: 360

Rep: Reputation: 30
Install lynx and ncftp (w/ ncftpput) then build this script

#!/bin/sh
#supply info
username=JoeUser
Password=ThePassWord
ftpserver=ftp.myserver.com

#dump and ftp
lynx -dump http://www.whatismyip.com > /tmp/myip.txt
ncftpput -u $username -p $password $ftpserver ./ /tmp/myip.txt
 
Old 11-20-2003, 04:38 PM   #3
mrtwice
Member
 
Registered: Feb 2002
Distribution: xubuntu 8.10
Posts: 225

Original Poster
Rep: Reputation: 31
that looks like it will work. Is there a way to log messages to the messages file from a bash prompt? I don't want to be root so I can't write directly to the file.
 
Old 11-20-2003, 05:57 PM   #4
JordanH
Member
 
Registered: Oct 2003
Location: Toronto, Canada
Distribution: Ubuntu, FC3, RHEL 3-4 AS Retired: SuSE 9.1 Pro, RedHat 6-9, FC1-2
Posts: 360

Rep: Reputation: 30
Do not write directly to /var/log/messages - bad news. Instead, use the logger command.

For more info;
man logger

Cheers.
 
  


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
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Public IP behind NAT abdul_zu Linux - Networking 12 07-08-2005 02:42 AM
forwarding Public IP address in BIND DNS on RedHat Linux EL3 pudhiyavan Linux - Networking 0 05-19-2005 04:16 AM
NAT + public IPS (+ firestarter) Stefan Pantiru Linux - Networking 2 05-17-2005 05:43 AM
how to use my Ip address if having a NAT router poeta_boy Linux - Networking 5 04-17-2004 06:10 PM
freeswan and public address c0c0deuz Linux - Networking 0 08-13-2003 10:42 PM


All times are GMT -5. The time now is 01:21 PM.

Main Menu
 
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
identi.ca: @linuxquestions
Facebook: @linuxquestions
Open Source Consulting | Domain Registration