Jump to content

IPTables


7calories

Recommended Posts

I just noticed a bug with linux scripting. If you create a script with these contents:

#~/bin/bash
export > variables.txt

 

After creating a service view variables.txt and you will see the tcadmin variables exist but you can't use them because of the period: ThisService.GamePort should be ThisService_GamePort

 

I will fix it in the next update.

Link to comment
Share on other sites

With these commands in the custom script, TCA will automatically push IPTables to open up the necessary ports when it creates the game servers? I was looking more along the lines of what is needed to be put into the custom script to get it to open up the port it uses when it makes servers.

Link to comment
Share on other sites

These scripts will work on the next update not on the current version:

 

Install script:

iptables -I INPUT -p udp --dport $[ThisServer_GamePort] -j ACCEPT
iptables -I INPUT -p udp --dport $[ThisServer_QueryPort] -j ACCEPT
iptables -I INPUT -p udp --dport $[ThisServer_RConPort] -j ACCEPT
/sbin/service iptables save

Uninstall script:

iptables -D INPUT -p udp --dport $[ThisServer_GamePort] -j ACCEPT
iptables -D INPUT -p udp --dport $[ThisServer_QueryPort] -j ACCEPT
iptables -D INPUT -p udp --dport $[ThisServer_RConPort] -j ACCEPT
/sbin/service iptables save

 

The iptables save command is for centos. I don't know how to save on Debian.

Link to comment
Share on other sites

  • 1 month later...

Sorry to open an old thread but we have servers that have multiple IP's and we want the ports to be opened for that specific ip not across all of them.

 

    iptables -A INPUT -p tcp -d $[ThisServer_IP] --dport $[ThisServer_GamePort] -j ACCEPT
   iptables -A INPUT -p udp -d $[ThisServer_IP] --dport $[ThisServer_GamePort] -j ACCEPT

 

We wouldn't want a lot of ports left open after they cancel/leave so what could we do for removing this ports when the server is moved or deleted?

 

I have looked most places and can't really find them. Anyone have any ideas?

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Who's Online   0 Members, 0 Anonymous, 140 Guests (See full list)

    • There are no registered users currently online
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. Terms of Use