MineOS Turnkey - Firewall rules not apply on server reboot

i have configured 4 firewall rules in the Turnkey network configuration. 3 for ports 25565, 66, 67 and another rule for port 8080 for the web management page, i have also chosen ‘yes’ for Activate at Boot. But whenever the server reboots i have no connectivity to the admin page on port 8080 or to either of the 3 servers and have to manually log into the turnkey settings and click ‘Apply Configuration’ before the firewall rules seem to take effect.

The best way to add/allow connections on ports is by using iptables from commandline. There isn’t really a need to mess with the turnkey firewall configuration as it seems to be overridden by iptables on startup.

To see the list of ports iptables opens up for use, execute this command: " iptables --list "
And by default, you should see this:

Chain INPUT (policy DROP)
target     prot opt source               destination
ACCEPT     tcp  --  anywhere             anywhere            tcp dpt:ssh
ACCEPT     tcp  --  anywhere             anywhere            tcp dpt:8080
ACCEPT     tcp  --  anywhere             anywhere            tcp dpt:25565
 
Chain FORWARD (policy ACCEPT)
target     prot opt source               destination
 
Chain OUTPUT (policy ACCEPT)
target     prot opt source               destination

So, to open up ports, execute the following command (per port), replacing “[PORT]” with the port number:

iptables -A INPUT -p tcp -m tcp --dport [PORT] -j ACCEPT

Then, when you finish opening the ports, save the list with the following command:

iptables-save > /etc/iptables-rules

And you should be set!

Source: http://minecraft.codeemo.com/mineoswiki/index.php?title=Iptables

1 Like

I find it easier to just edit iptables-rules directly and add the stuff I want there.
Then you can either restart or do the iptables-restore

thanks you guys for the quick reply! I didn’t really know what I was doing and was just following a guide i found in the forum somewhere which explained installing Mod Pack’s and opening the firewall up. All fixed not thank you guys :slight_smile: