Beefy Boxes and Bandwidth Generously Provided by pair Networks
Welcome to the Monastery
 
PerlMonks  

Socket Server and DMZ

by rupesh (Hermit)
on Sep 24, 2003 at 13:25 UTC ( [id://293841]=perlquestion: print w/replies, xml ) Need Help??

rupesh has asked for the wisdom of the Perl Monks concerning the following question:

Hi..
I have a socket and a server script in perl, which I use in Windows. (ActiveState Perl). My question is that if I have a socket server running on a machine which is under DMZ, will the client reach it? Or is there any way in which I can allow only specific ports to listen to it?

Has anyone tried this before? All Im trying to do is pass some parameters to another script in some boxes. Unfortunately, they are under a firewall (DMZ) which blocks certain default ports.

Any Suggestions would be helpful

Thanks, Rupz

Replies are listed 'Best First'.
Re: Socket Server and DMZ
by hardburn (Abbot) on Sep 24, 2003 at 13:37 UTC

    This isn't really a Perl question, but a networking one.

    If you can do a telnet <host>:<port> and get a response, your Perl code can do the same. This question depends a lot on the specific configuration of the firewall and the rest of the network, which is information that doesn't belong on a public fourm.

    ----
    I wanted to explore how Perl's closures can be manipulated, and ended up creating an object system by accident.
    -- Schemer

    Note: All code is untested, unless otherwise stated

Re: Socket Server and DMZ
by tcf22 (Priest) on Sep 24, 2003 at 13:46 UTC
    You just need to find out which ports are available for you to listen on. Then simply setup a socket listener on one of those ports.
    use strict; use IO::Socket; my $Socket = IO::Socket::INET->new( LocalPort => 8190, Type => SOCK_STREAM, Reuse => 1, Listen => 1 ); my ($client); while($client = $Socket->accept()){ ##Do something with socket handle }
    This one for example, listens on 8190.

    - Tom

Re: Socket Server and DMZ
by tstock (Curate) on Sep 24, 2003 at 13:43 UTC
    Ultimately it depends on how the DMZ is setup, and on the firewall rules. I would assume that if a default deny policy is in place you wont be able to just spin up a tcp server on the DMZ and be able to connect to it from the outside or the inside.

    You would likely be able to access the server from other servers on the DMZ and certainly locally, so it is easy to test if it's a codding problem or network problem.

    If it's a network problem, you will need help from the network administrator.

    Tiago
Re: Socket Server and DMZ
by Anonymous Monk on Sep 25, 2003 at 03:45 UTC
    Hello,
    Since I have no idea what DMZ is, could anyone tell me what rupzperl is trying to say?
    I have had a chance to use sockets but why should it not be able to access the DMZ (What is it? )...
    Tk..

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlquestion [id://293841]
Approved by Corion
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others meditating upon the Monastery: (4)
As of 2024-04-19 22:58 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found