Jump to content
metin2dev
Shogun

PF Sample Config

Recommended Posts

On 28/12/2017 at 12:57 PM, monarchis2 said:

Im getting kicked out after char slection.

Check this one:

Spoiler

# pf config by Tim Niederhausen

# Change the value to reflect your public interface. You can see this with ifconfig.
ext_if="vtnet0"

# Ports used for services
service_ports="{ 46825, 3306, 41144, 30033, 10011 }"

udp_ports="{ 9987 }"

# Ports used by Metin2
game_ports="{ 11002, 13000, 13001, 13002, 13099 }"

# IP addresses that should override the firewall rules, such as your web server.
table <trusted_hosts> const { 208.167.241.190, 208.167.241.185, 208.167.241.186, 208.167.241.183, 208.167.241.189, 108.61.78.147, 108.61.78.148, 108.61.78.149, 108.61.78.150 }

table <abusive_hosts> persist

set block-policy drop
set loginterface $ext_if
set skip on lo

scrub on $ext_if reassemble tcp no-df random-id

antispoof quick for { lo0 $ext_if }

block in

pass out all keep state
pass out on $ext_if all modulate state

pass in quick from <trusted_hosts>
block in quick from <abusive_hosts>

# Allow ping in
block in inet proto icmp all icmp-type echoreq

# Rate limits, trial and error
pass in on $ext_if proto tcp to any port $service_ports flags S/SA keep state (max-src-conn 30, max-src-conn-rate 15/5, overload <abusive_hosts> flush)

pass in on $ext_if proto udp to any port $udp_ports keep state (max-src-conn 30, max-src-conn-rate 15/5, overload <abusive_hosts> flush)

pass in on $ext_if proto tcp to any port $game_ports flags S/SA keep state (max-src-conn 30, max-src-conn-rate 15/5, overload <abusive_hosts> flush)

 

This one was working on my old server, see if it works for you...

Don't forget to edit the IP's and the ports, I had those IP's because teamspeak 3 server...

Share this post


Link to post
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

  • Recently Browsing   0 members

    No registered users viewing this page.

×