13 lines
480 B
Bash
13 lines
480 B
Bash
#!/bin/bash
|
|
|
|
clear
|
|
|
|
sudo nft -f /etc/nftables.conf
|
|
sudo sysctl -w net.ipv4.ip_forward=1
|
|
sudo sed -i 's/DEFAULT_FORWARD_POLICY="DROP"/DEFAULT_FORWARD_POLICY="ACCEPT"/g' /etc/default/ufw
|
|
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 ufw reload ; sudo ufw status
|
|
sudo nft list ruleset #| sudo tee /etc/nftables/port-forwarding.nft
|