Upload files to "/"
This commit is contained in:
1 parent
8e28a1e32f
commit
d25ea180e1
1 file changed
+21
@@ -0,0 +1,21 @@
|
||||
#!/bin/bash
|
||||
|
||||
iprt=$1
|
||||
oprt=$2
|
||||
oipa=$3
|
||||
|
||||
#echo 1 > /proc/sys/net/ipv4/ip_forward
|
||||
#iptables -F
|
||||
#iptables -t nat -F
|
||||
iptables -t nat -A PREROUTING -p tcp --dport $iprt -j DNAT --to-destination $oipa:$oprt
|
||||
#sudo iptables -t nat -A POSTROUTING -j MASQUERADE
|
||||
#sudo iptables -t nat -L -n -v
|
||||
#sudo iptables-persistent
|
||||
|
||||
sudo sysctl -w net.ipv4.ip_forward=1
|
||||
sudo nft add table ip nat
|
||||
sudo nft add chain ip nat prerouting { type nat hook prerouting priority -100 \; }
|
||||
sudo nft add chain ip nat postrouting { type nat hook postrouting priority 100 \; }
|
||||
sudo nft add rule ip nat prerouting tcp dport $iprt dnat to $oipa:$oprt
|
||||
sudo nft add rule ip nat postrouting ip daddr $oipa masquerade
|
||||
sudo nft list ruleset | sudo tee /etc/nftables/port-forwarding.nft
|
||||
Reference in new issue
Block a user