add script to nft map ports to ssh port
All checks were successful
Gitea Actions Demo / Explore-Gitea-Actions (push) Successful in 8s
All checks were successful
Gitea Actions Demo / Explore-Gitea-Actions (push) Successful in 8s
This commit is contained in:
parent
0b7ba88068
commit
37eeb06a47
1 changed files with 9 additions and 0 deletions
9
map-ports-to-ssh
Normal file
9
map-ports-to-ssh
Normal file
|
@ -0,0 +1,9 @@
|
|||
#!/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
|
Loading…
Add table
Reference in a new issue