On Aug 3, 9:43 pm, [EMAIL PROTECTED] (Jeff Pang) wrote:
> -----Original Message-----
> >From: [EMAIL PROTECTED]
> >Sent: Aug 4, 2007 6:49 AM
> >To: [EMAIL PROTECTED]
> >Subject: automatically open ports
>
> >Im not sure where to post this as Im really looking for the
> >functionality not specifically that it have to be in the perl
> >language.
>
> >How would I make something that would automatically open the correct
> >ports for a certain machine without my having to be at the machine
> >goto 192.168.1.1 in a browser and open the ports manually? Can this be
> >done easily?
>
> I don't know what's your intent for this.Do you mean when there's a 
> connection to this host,it should open a port to accept the connection,at 
> other time it shouldn't open that port?AFAIK,this is impossible.Though using 
> some tools like PF port forwarding or LVS,you can't see the ports opened on a 
> host but they are really on there,it's nothing you wanted here.
> Instead you can always open a port on the host and accept the connection,but 
> use firewall (like iptables) to filter the info you wanted and drop the info 
> you unwanted.
> Opening a port generally need to build a socket server.In perl it's easy to 
> do,see 'perldoc IO::Socket' for the description.
>
> --
> Jeff Pang <[EMAIL PROTECTED]>http://home.arcor.de/jeffpang/

I'm sorry. I wasnt clear in my first post. A situation arises when my
router gets restarted, the internal ip addresses of the computers in
my home (192.168.1.100 and the like) are shifted around. Normally I
have the router forward some ports to one of my computers for a few
services that I like to have, like an ftp server.

What I want to do is create a perl script that runs in cron that will
make sure my router is forwarding the ports I want it to. But the
thing is, the only interface I know of for doing such things is the
web interface to my router. It needs the mouse to select checkboxes
and fill in textboxes. It would be great if I can script this action
to run on a regular basis especially since Im not always home when the
ips get switched around.

Thanks


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/


Reply via email to