Portal Home > Knowledgebase > Articles Database > Add port on CSF & Iptables
Add port on CSF & Iptables
Posted by gatsu, 08-19-2011, 04:52 AM |
Is there a command line to add a port to CSF? We want to be able to have some of our programs dynamically opening particular ports as they need them.
Also if we try to add commands via iptables they don't seem to open. Does CSF just overwrite any commands that are manually put into iptables?
This is the command we are using and it doesn't seem to work. It is attempting to open a specific port on a specific IP within our server.
iptables -A INPUT -p tcp -d (our IP) --dport (our port) -j ACCEPT
Comments and suggestions are appreciated.
|
Posted by amaziah, 08-19-2011, 06:41 AM |
please edit and add the port in TCP_IN and TCP_OUT. And dynamic ports specify the range. And run to restart csf.
|
Posted by brianoz, 08-19-2011, 12:02 PM |
Check out CSF's use of chains, you're probably adding it to the wrong chain ...
|
Posted by gatsu, 08-19-2011, 01:08 PM |
We would need something from the command line it is difficult for a shell script to open a file and know exactly where to put the port in the conf file.
|
Posted by Ronald_Craft, 08-19-2011, 02:11 PM |
If you want to use CSF, you'll have to use the csf.conf file or whitelist manually in the csf.allow file and then csf -r to reload the rules.
Otherwise, you might as well use iptables. As was previously mentioned, you're probably adding the rule to the wrong chain. Run an csf -L to see the list of chains and read up on the documentation for CSF.
|
Posted by khunj, 08-20-2011, 11:59 AM |
Consider Inserting your rule - in 1st position - rather than Appending it - in last position :
|
Posted by JohnRambo1872, 08-20-2011, 04:32 PM |
thanks for the explanation.
|
Add to Favourites Print this Article
Also Read