Code:
cat <<EOF> /root/ipfw
#!/bin/sh
kldload ipfw_nat
ipfw -q -f flush
ipfw -q nat 1 config if em0 redirect_port tcp Public_IP_address:22 2222
ipfw -q add 10 nat 1 ip from any to any
ipfw -q add 00100 allow all from any to any via lo0
ipfw -q add 00200 allow icmp from any to any
ipfw -q add 00300 allow tcp from any to any 22,2222,80,443,8443,53,853 setup keep-state
ipfw -q add 00400 allow udp from any to any 53,853,4000,5000 keep-state
EOF
Code:
root@freebsd:~ # cat /etc/rc.conf
firewall_enable="YES"
firewall_type="open"
gateway_enable="YES"
ss5_enable="YES"
FreeBSD run on digitalocean
I installed ss5 proxy server using tcp 1080 port
The problem I encountered
In FreeBSD 13.0-RELEASE
I can forward Public_IP_address:22
And tcp 1080 port is forbidden to access
psping my_vps_ipaddr:2222
is ok
psping my_vps_ipaddr:1080
is block (this is the block I need, because my ss5 has no password, I use udp to forward tcp 1080 through kcptun)
However in FreeBSD 12.2-RELEASE
My firewall rules are all allowed
I did not allow tcp 1080
But tcp 1080 is accessible on the public network
The same configuration and rules, in the 13.0/12.2 system version, actually have different results
Excuse me, why is this?