Jarvis, John on Fri, 24 Aug 2001 17:50:12 +0200


[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]

RE: [PLUG] Re: Linksys router / general networking questions


No problem, glad to help :) 

Basically all the linksys routers are similiar, I have the EtherFast 4-Port
Cable/DSL router.
Also another heads up, I had lots of trouble with firmware version 1.39 on
the router (the on that implements IPSec passthru) and linux.. I would
suggest not upgrading to this version or if you are running with it now and
have trouble pulling up large webpages off your box or transfering large
files from the outside look into downgrading to the last revision. (anybody
else have this problem??)

Here is the perl script.. the.shacknet.nu and jarv.dyndns.org are my dynamic
domain names, the "ddup" application is what updates the dns entry through
dyndns.org
192.168.64.1 is the address of the dsl router (basically I just grab the
Status page on the router to get my IP address)
You will need to create a file "IP_ADDRESS" (which i keep in my
/usr/local/sbin/ directory) that contains your current IP address (this is
what the script looks at to see if the IP changes).


Then its just a matter of setting up a crontab to run every 5-10 minutes, I
output this to my message of the day (/etc/motd) so I know my IP and any
problems when I log on.

-John


#!/usr/bin/perl

`/usr/bin/wget -q http://192.168.64.1/Status.htm -O
/usr/local/sbin/output.txt`;

open (STATUS, "</usr/local/sbin/output.txt") or die "CAN'T OPEN STATUS!!";
open (ADDIE, "</usr/local/sbin/IP_ADDRESS") or die "CAN'T OPEN IP FILE!!!";

`/bin/rm /usr/local/sbin/output.txt`;
my $status = <STATUS>;
my $last_ip = <ADDIE>;
close (STATUS);
close (ADDIE);

if ($status =~ /Status: Connected/)  {



  if ($status =~ /141\.\d+\.\d+\.\d+/)  {
    my $ip_address = $&;
    if ($ip_address !~ $last_ip) {
      print "IP doesn't match\n";
      `/sbin/ddup --ip $ip_address --host the.shacknet.nu`;
      `/sbin/ddup --ip $ip_address --host jarv.dyndns.org`;
      open (ADDIE, ">/usr/local/sbin/IP_ADDRESS") or die "CAN'T OPEN IP
FILE!!!";

     print ADDIE "$ip_address";
      close(ADDIE);
      print "IP Address just changed to $ip_address";
    }
    else {
      print "Welcome to the.shacknet.nu $ip_address\n";
    }
  }
  else {
    print "We have some serious problems with our IP Address!";

  }
}


else {
  print "We have no network connectivity!!";
}


-----Original Message-----
From: jbeck@jbwd.net [mailto:jbeck@jbwd.net]
Sent: Friday, August 24, 2001 11:09 AM
To: plug@lists.phillylinux.org
Subject: [PLUG] Re: Linksys router / general networking questions


John, are you currently using the linksys router I mentioned?  Can you make 
a recommendation as to whether it is a good brand / model?  I did look at 
the manual online but didn't pick up the part about port forwarding - thank 
you for that recommendation.  Also thank you for the suggestion about using 
static ip's - from what I read online in the manual, it seems that it is 
more geared towards DHCP.  Using static IP's seems to make sense per your 
note below.

Could I take a look at the Perl script you wrote?  My knowledge of Perl is 
limited, but I am learning, and this sounds like something that will be 
useful in the near future.  I plan on purchasing the router in the next 1-2 
weeks, so I am sure that I will have many more questions in the future! 

Thanks again! 

John 


Jarvis, John writes: 

> John, 
> 
> The first thing I would do would be to read the linksys manual :) All you
> need to do is set up port forwarding on the linksys to route incoming
> requests for port 80 to your redhat box.  You shoud do likewise if you
plan
> to run mail services or ftp (bad), telnet (bad), ssh (good). 
> 
> You can set up the router to use DHCP although I usually turn that off, if
> you only have 3 machines I suggest that leave DHCP off and make up your
own
> IP addresses on the CLASS C reserved 192.168.x.x and use your the dsl
router
> as a gateway. 
> 
> For example, my setup. 
> 
> DSL router - 192.168.64.1 
> 
> 3 linux boxes
> maggie	192.168.64.2
> bart		192.168.64.3
> lisa		192.168.64.4 
> 
> And one ME box
> homer		192.168.64.5 
> 
> 
> When you set up the linux boxes you will need to specify the linksys
router
> box as your gateway, put in your ISPs DNS servers and you will be ready to
> rock. 
> 
> My IP address is dynamic so I wrote a small perl script that grabs the IP
> address from the linksys box and updates my entry at dyndns.org, if you
want
> I can let you look at it.. its pretty simple, just does a wget on the
> router, compares it to the last IP address and updates my dynamic dns if
> necessary. 
> 
> -John 
> 
> 
> -----Original Message-----
> From: jbeck@jbwd.net [mailto:jbeck@jbwd.net]
> Sent: Friday, August 24, 2001 8:43 AM
> To: plug@lists.phillylinux.org
> Subject: [PLUG] Linksys router / general networking questions 
> 
> 
> Hi all, 
> 
> I have a few questions regarding networking - I am hoping some people here

> can help me out. I am a total newbie to networking, so keep that in
mind...  
> 
> I currently have 3 pc's at home - a dual boot PC with win98+ slackware8.0 
> that is connected to the net via a cable modem (service from @home), a 
> standalone Pentium desktop with RH 7.1, and a laptop with WinME. As I 
> mentioned, the only one connected to the net is the dual boot one...  
> 
> I saw a Linksys 4 port Cable/DSL router that would allow me to share my 
> cable connection with the other computers. So, my first question is: how 
> well do these work with Linux? Any problems, etc? It looks as though it 
> comes with an install CD for windows, though I don't know what it does.
The 
> ad says you can configure it through any browser connected to the router.
If 
> 
> that is so, what's the disk for?  
> 
> OK, assuming I need the disk, and install the software on the windows part

> of the dual boot computer to get things started, can the RedHat computer
see 
> 
> and share files with the Dual boot computer? They would both be "behind
the 
> router" or connected to their own port on the back of the router. The
router 
> 
> can act as a DHCP device, so the computers plugged into it can obtain IP 
> info automatically... Is this the best way to go...? I would like to be
able 
> 
> to, for example, access files on the windows machine from the RedHat 
> machine, and vice versa...  
> 
> Now about the laptop - I don't use it all the time, but can it just be 
> plugged into the router when I need to use it, and disconnected when I 
> don't? Will that cause problems?  
> 
> Finally, I have one last question. What if I wanted to use the Redhat 
> computer to run apache and serve up static web pages for my own use. I 
> already own a few domain names, so could I use one (for ex. 
> www.mydomain.com) and have it access files that are on the redhat box that

> is connected to the router? If I can, how is this done? What tells the 
> router to send requests for www.mydomain.com to the redhat box?  
> 
> Whew! That's alot of stuff! I know that this is all over the place, but I 
> figured best to write it down now and ask, before I forget or go off
without 
> 
> being prepared.  
> 
> Thanks for any help you can provide!  
> 
> John  
> 
> 
> ______________________________________________________________________
> Philadelphia Linux Users Group       -      http://www.phillylinux.org
> Announcements-http://lists.phillylinux.org/mail/listinfo/plug-announce
> General Discussion  -  http://lists.phillylinux.org/mail/listinfo/plug 
> 
> 
> ______________________________________________________________________
> Philadelphia Linux Users Group       -      http://www.phillylinux.org
> Announcements-http://lists.phillylinux.org/mail/listinfo/plug-announce
> General Discussion  -  http://lists.phillylinux.org/mail/listinfo/plug 
> 
 


______________________________________________________________________
Philadelphia Linux Users Group       -      http://www.phillylinux.org
Announcements-http://lists.phillylinux.org/mail/listinfo/plug-announce
General Discussion  -  http://lists.phillylinux.org/mail/listinfo/plug


______________________________________________________________________
Philadelphia Linux Users Group       -      http://www.phillylinux.org
Announcements-http://lists.phillylinux.org/mail/listinfo/plug-announce
General Discussion  -  http://lists.phillylinux.org/mail/listinfo/plug