> For the complete documentation index, see [llms.txt](https://miftycoin.gitbook.io/miftycoin-broker-node-configuration/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://miftycoin.gitbook.io/miftycoin-broker-node-configuration/setup/setup-the-firewall.md).

# Setup the Firewall

{% hint style="info" %}
In order to protect your server against common attacks, it is recommended that you setup a firewall. The following instructions assume that you have installed firewalld.
{% endhint %}

```
$ vi /etc/firewalld/zones/public.xml
```

Insert the following lines between the \<zone> and \</zone> tags:

```
  <port protocol="tcp" port="10000"/>
  <port protocol="tcp" port="80"/>
  <port protocol="tcp" port="8080"/>
  <port protocol="tcp" port="25"/>
  <port protocol="tcp" port="465"/>
  <port protocol="tcp" port="443"/>
  <forward-port to-port="8080" protocol="tcp" port="80"/>
  <forward-port to-port="8443" protocol="tcp" port="443"/>
```

Save and exit with :x&#x20;

```
$ vi /etc/firewalld/direct.xml
```

This file should contain the following:

```
<?xml version="1.0" encoding="utf-8"?>
<direct>
  <rule priority="0" table="filter" ipv="ipv4" chain="OUTPUT">-p tcp -m tcp --dport=25 -j ACCEPT</rule>
  <rule priority="0" table="filter" ipv="ipv4" chain="OUTPUT">-p tcp -m tcp --dport=23 -j ACCEPT</rule>
  <rule priority="0" table="filter" ipv="ipv4" chain="OUTPUT">-p tcp -m tcp --dport=80 -j ACCEPT</rule>
  <rule priority="0" table="nat" ipv="ipv4" chain="OUTPUT">-p tcp -o lo --dport 80 -j REDIRECT --to-ports 8080</rule>
</direct>
```

Save and exit with :x&#x20;

After completing the above edits, reload the firewall configuration:

```
$ firewall-cmd --reload
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://miftycoin.gitbook.io/miftycoin-broker-node-configuration/setup/setup-the-firewall.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
