Koozali.org: home of the SME Server

Opening Ports

Offline xviper

  • *
  • 6
  • +0/-0
Opening Ports
« on: January 15, 2008, 11:01:05 AM »
Hello,

I am trying to open ports other than the usual, like 8153 etc.

I followed the instructions on the page for IPtables on SME in the manual, but I was not successful. Her is what I tried;

config set service1 service access public status enabled TCPPort 8153
signal-event remoteaccess-update
cp /etc/rc.d/init.d/masq /tmp
config setprop service1 access private
signal-event remoteaccess-update


Can you tell me tell me where I went wrong with the above.

thanks

Offline cactus

  • *
  • 4,880
  • +3/-0
    • http://www.snetram.nl
Re: Opening Ports
« Reply #1 on: January 15, 2008, 11:06:02 AM »
Hello,

I am trying to open ports other than the usual, like 8153 etc.

I followed the instructions on the page for IPtables on SME in the manual, but I was not successful. Her is what I tried;

Code: [Select]
cp /etc/rc.d/init.d/masq /tmp
Why are you copying the masq init script to the /tmp folder? Shouldn't you make a copy of it under the same directory with named service1?
Can you provide a link to the referenced documentation as I can not find it that quick.
« Last Edit: January 15, 2008, 11:07:53 AM by cactus »
Be careful whose advice you buy, but be patient with those who supply it. Advice is a form of nostalgia, dispensing it is a way of fishing the past from the disposal, wiping it off, painting over the ugly parts and recycling it for more than its worth ~ Baz Luhrmann - Everybody's Free (To Wear Sunscreen)

Offline raem

  • *
  • 3,972
  • +4/-0
Re: Opening Ports
« Reply #2 on: January 15, 2008, 11:52:23 AM »
xviper

If you want a port to be forwarded to another port on your sme server, use the Port Forward (& opening) panel in server manager, and forward to
localhost
rather than another internal servers IP

See this howto for an example of usage
http://wiki.contribs.org/PortRedirect


You would use the commands you referred to (in the correct way of course) if you want to enable a new service on a particular port
ie a service other than the default services already running on default ports.
...

Offline xviper

  • *
  • 6
  • +0/-0
Re: Opening Ports
« Reply #3 on: January 15, 2008, 01:05:26 PM »
Thank you for your replies;

CACTUS:
Yes, I went to the developers manual and done a search for "TCPPort"
Here is the extract;

The SME Server approach provides better security than a typical firewall, because the SME Server is managed automatically. Conventional firewalls have complex user interfaces, and require a system administrator to choose policies (e.g. which services should be permitted, which ports should be forwarded, etc.) The SME Server firewall has no user interface. It automatically generates the best ruleset that is consistent with the server settings, and is automatically regenerated whenever the server settings are changed. Creating firewall pinholes for your application

Let us say that your service needs to provide a public service on TCP/IP port 4321, which is normally blocked by the firewall rules. All that you need to do is define this to the SME Server

config set myservice service TCPPort 4321 access public status enabled
signal-event remoteaccess-update

Note that a firewall hole is only opened if three things are true - the service has a TCPPort (or UDPPort) definition, the service is set to public access, and the service is enabled. Run the commands above, and then these ones:

cp /etc/rc.d/init.d/masq /tmp
config setprop myservice access private
signal-event remoteaccess-update
diff -u /etc/rc.d/init.d/masq /tmp/masq

This will produce output something like this:

[root@gsxdev1 esmith]# diff -u /tmp/masq /etc/rc.d/init.d/masq --- /tmp/masq 2006-02-02 13:14:09.000000000 +1100 +++ /etc/rc.d/init.d/masq 2006-02-02 13:14:13.000000000 +1100 @@ -340,9 +340,7 @@



RAY

I am runing the box in "Server Only" mode

The way I normally check to see if a port is open, is by opening the Command prompt on my windows desktop and type;

telnet xxx.xxx.xxx.xxx 80

That would let me know that port 80 is open, however, when I do it with 8153, after issuing the above commands, I get "could not open connection to host"


Offline cactus

  • *
  • 4,880
  • +3/-0
    • http://www.snetram.nl
Re: Opening Ports
« Reply #4 on: January 15, 2008, 03:44:06 PM »
Thank you for your replies;
If you would have read things properly it states this is all you need:
Creating firewall pinholes for your application
Let us say that your service needs to provide a public service on TCP/IP port 4321, which is normally
blocked by the firewall rules. All that you need to do is define this to the SME Server
Code: [Select]
config set myservice service TCPPort 4321 access public status enabled
signal-event remoteaccess-update

Note that a firewall hole is only opened if three things are true - the service has a TCPPort (or UDPPort) definition, the service is set to public access, and the service is enabled. Run the commands above, and then these ones:

The rest displays what is the difference between a private and a public service in the firewall rules.
Be careful whose advice you buy, but be patient with those who supply it. Advice is a form of nostalgia, dispensing it is a way of fishing the past from the disposal, wiping it off, painting over the ugly parts and recycling it for more than its worth ~ Baz Luhrmann - Everybody's Free (To Wear Sunscreen)

Offline xviper

  • *
  • 6
  • +0/-0
Re: Opening Ports
« Reply #5 on: January 15, 2008, 08:31:56 PM »
Yes, it's working now, the upshot is start the service and issue the commands below;

config set myservice service TCPPort 4321 access public status enabled
signal-event remoteaccess-update

Thanks for the help