nsbin/map-ports-to-ssh
Nico Schottelius 37eeb06a47
All checks were successful
Gitea Actions Demo / Explore-Gitea-Actions (push) Successful in 8s
add script to nft map ports to ssh port
2024-09-06 11:45:07 +09:00

9 lines
299 B
Bash

#!/bin/sh
nft add table ip nat
nft -- add chain ip nat prerouting { type nat hook prerouting priority -100 \; }
nft add chain ip nat postrouting { type nat hook postrouting priority 100 \; }
for port in 20 21 53 80 443; do
nft add rule ip nat prerouting tcp dport ${port} redirect to :22
done