> For the complete documentation index, see [llms.txt](https://docs.proudnet.com/proudnet.eng/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.proudnet.com/proudnet.eng/proudnet-note/notes/setting_firewall.md).

# Setting up a server firewall

If your game server is protected by a firewall, you must consider the following for ProudNet to perform properly.

> * When the server is started (<mark style="color:orange;">Proud.CNetServer.Start</mark>), the UDP ports specified in <mark style="color:orange;">Proud.CStartServerParameter.m\_tcpPort</mark> (<mark style="color:orange;">Proud.CStartServerParameter.m\_udpPorts</mark>) must be open for both sending and receiving.
> * Unless absolutely necessary, you should disallow sending and receiving ICMP-type IP packets to avoid occasional network failures.

## Setting up a firewall against DDOS attacks

In ProudNet, when a client connects, the server first throws a random packet to the client before any UDP communication, and the client receives it and discards it.

Some server firewalls have the ability to send UDP packets to a client with internet address A first, and then allow A to send UDP packets to the server, but only for a certain amount of time. With this feature turned on, ProudNet can be used to set up a firewall that keeps UDP open but is still secure against DDOS attacks.

If your firewall is capable of this, you can run the server with only the <mark style="color:orange;">Proud.ServerUdpAssignMode\_PerClient</mark> and empty <mark style="color:orange;">Proud.CStartServerParameter.m\_udpPorts</mark> settings, which has the added benefit of minimizing the concurrent connections limit.

{% hint style="success" %}
**Reference**

[**How the server uses UDP port**](/proudnet.eng/proudnet/usage_pn/tips.md#how-the-server-uses-udp-ports)
{% endhint %}

## Setting up an ICMP firewall

If you use <mark style="color:orange;">Proud.ServerUdpAssignMode.ServerUdpAssignMode\_Static</mark> in your server startup options, we recommend that you block receiving <mark style="color:orange;">ICMP host unreachable</mark> packets.

This is an example of how to set it up when using Windows Firewall.

<figure><img src="/files/1kiPftHzCenRMjhGayj4" alt=""><figcaption><p>Example of how to enable firewall</p></figcaption></figure>

<figure><img src="/files/0fwcJ4kCp1asoryViQvU" alt=""><figcaption></figcaption></figure>

<figure><img src="/files/tpN83c9KsydTNyKK6OB1" alt=""><figcaption></figcaption></figure>

<figure><img src="/files/DFNLvBZSOYfAvGhGbGXq" alt=""><figcaption></figcaption></figure>

<figure><img src="/files/H9hPQO8QvvOQVBPRo4MC" alt=""><figcaption></figcaption></figure>

<figure><img src="/files/8cyRhf39kjmTwUOpTc9P" alt=""><figcaption></figcaption></figure>

<figure><img src="/files/KaPJci2VvJbSxKm2jLA2" alt=""><figcaption></figcaption></figure>

<figure><img src="/files/kvHCVLnOOXEaFHtBvCQO" alt=""><figcaption></figcaption></figure>

From now on, just keep pressing the ‘Next’ button until ‘Finish’ appears.

{% hint style="success" %}
**Reference**

[**How the server uses UDP port**  ](/proudnet.eng/proudnet/usage_pn/tips.md#how-the-server-uses-udp-ports)
{% endhint %}
