Linux Help
guides forums blogs
Home Desktops Distributions ISO Images Logos Newbies Reviews Software Support & Resources Linuxhelp Wiki

Welcome Guest ( Log In | Register )



Advanced DNS Management
New ZoneEdit. New Managment.

FREE DNS Is Back

Sign Up Now
> Server On A Non-static Ip
Jim
post May 6 2004, 11:59 AM
Post #1


Its GNU/Linuxhelp.net
*******

Group: Support Specialist
Posts: 1,280
Joined: 19-November 03
From: University of Minnesota- TC
Member No.: 1,828



So I don't have a tip or trick on how to do this, but I want someone to help me make one.

So I want to be able to host a ssh/apache server from my home, which has a semi-static IP address. It doesn't really change all that often, but they reserve the right to so it does every now and than. So this won't be such a big deal this summer as I will be able to have the computer infront of me if the IP changes. Whats going to screw me is when I am away from school.

So the question is any ideas on how to deal with a semi-static IP? My thought was having some sort of auto-scheduled task to e-mail me the IP when it reboots. Because it wont get new IP unless I do a network restart or a reboot on it. Than I could always have the IP. I don't even know if thats possible and or how I would do that.

Getting a staic IP isn't a financial option or even possible since they don't offer them where I am at and on home services. So how do you host a server on a semi-static IP address?


--------------------
--Jim Lester
jim@linuxhelp.net

Distro: Gentoo
System: AMD Athlon 3000+ XP 2.166 GHz
NVIDIA nForce2 IGP Chipset
1GB 333 MHz DDR SDRAM
NVIDIA nForce2 Dual Head 64 MB Graphics

Server Distro: CentOS
Go to the top of the page
 
+Quote Post
 
Start new topic
Replies
hughesjr
post May 26 2004, 07:37 PM
Post #2


Its GNU/Linuxhelp.net
*******

Group: Admin
Posts: 3,433
Joined: 25-July 03
From: Corpus Chrsiti, TX, USA
Member No.: 1,151



Corey,
MyIP.com is always overloaded ... at least for me ... but whatismyip.com is usually faster.

This works:

CODE
lynx -source http://www.whatismyip.com/ | grep 'TITLE' | awk '{split($0,a,"is");split(a[2],a," ");print a[1];exit}'


so in the context of my script, you can remove the line:

CODE
###############################
#External Interface (if on this machine)

EXTIF="eth0"


and replace:

CODE
EXTIP="`$IFCONFIG $EXTIF | $AWK /$EXTIF/'{next}//{split($0,a,":");split(a[2],a," ");print a[1];exit}'`"


with

CODE
EXTIP="`$LYNX -source http://www.whatismyip.com/ | $GREP 'TITLE' | $AWK '{split($0,a,"is");split(a[2],a," ");print a[1];exit}'`"


and it should work


#################EDITED#############################

I edited the original scripts (earlier in this post) to include a second option to do a Domain lookup if you have an external router ... or if you are running it on the router.

This post has been edited by hughesjr: May 31 2004, 02:23 PM


--------------------
Johnny Hughes
hughesjr@linuxhelp.net
Enterprise Alternatives: CentOS, WhiteBoxEL
Favorite Workstation Distros (in order): CentOS, Gentoo, Debian Sarge, Ubuntu, Mandrake, FedoraCore, Slackware, SUSE
Favorite Server Distros (in order): CentOS, WhiteBoxEL, Debian Sarge, Slackware, Mandrake, FedoraCore, Gentoo, SUSE
Go to the top of the page
 
+Quote Post

Posts in this topic


Reply to this topicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

 



RSS Lo-Fi Version Time is now: 18th December 2017 - 09:54 AM