#Best way to configure Firewall Rules (with firewalld) for Pterodactyl / Docker

31 messages · Page 1 of 1 (latest)

coarse lintel
#

I'm in the process of trying to configure our Firewall to keep our server secure after we've setup and configured Pterodactyl, I'm hoping to configure firewalld to allow Docker to manage the opened ports when a new allocation is opened / assigned in Pterodactyl I've opened ports 80 and 443 in the public zone by default as well as 3306, but when starting containers they struggle to connect to internet-based services (but are able to access their respective databases) and show errors, what do I need to do or look into to get this type of (hopefully possible) setup to work?

#

If this hasn't been posted in the correct place, please let me know if I should post it elsewhere

eternal sequoia
#

Docker by default automatically forwards container ports through iptables, so if you're also running firewalld, it can sometimes conflict. In your case you'll most likely want to allow docker to continue to use iptables and configure firewalld to allow docker container traffic through. Typically docker creates its own "docker" zone in firewalld with an Accept target, though you may have to check your own configurations.

coarse lintel
eternal sequoia
# coarse lintel For reference I'm just starting off with firewalld / Pterodactyl myself so are t...

Truthfully I've not used firewalld myself (i use ufw), so someone else is better off stepping in to assist you with configuring that.
In theory though the docker zone should've been created automatically which allows wings ports to communicate through it but you may need to check if your existing rules you've setup, that they don't block all traffic and then restart the docker/firewall services thereafter.

coarse lintel
eternal sequoia
#

If anything i'd recommend disabling firewalld temporarily and see if things function correctly without it, so you'll at least know where you can start troubleshooting in the future.

coarse lintel
eternal sequoia
#

firewall-cmd --zone=docker --list-all should show you all the current rules within the docker zone, do these match your running containers within pterodactyl?

coarse lintel
eternal sequoia
eternal sequoia
coarse lintel
eternal sequoia
coarse lintel
eternal sequoia
jovial jacinthBOT
#

Please explain the issue you're experiencing in as much detail as possible. Preferably with error messages in a text format or paste link to logs. Nobody can assist you without information that helps to understand the issue. Help us help you. Messages such as "doesn't work" or "i need help" will most likely be ignored.

coarse lintel
jovial jacinthBOT
#

I have found the following for: https://ptero.co/limigiqazi
You already have an instance of Wings running through systemd service and are trying to start another duplicate instance, for example by using the commands wings and wings --debug, or another service is using the port.

Use ss -plnt | grep :8080 (or grep :8443 depending on the port) to find what process is currently running and stop it. You can type killall wings to shutdown any ghost Wings process.

coarse lintel
eternal sequoia
#

Well it is present in your logs, you do have something already bound to 8443

coarse lintel
eternal sequoia
#

Are you able to query the container and the external services you're trying to connect to?

coarse lintel
eternal sequoia
#

I just meant are you able to connect to these services manually outside of pterodactyl. Have you also opened 8443 in the public zone as well?

coarse lintel