Files

13 lines
483 B
Bash
Raw Permalink Normal View History

2026-09-25 23:24:59 +00:00
#!/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
2026-09-26 00:03:35 +00:00
sudo ufw reload
2026-09-25 23:24:59 +00:00
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 \; }
2026-09-26 00:03:35 +00:00
sudo ufw status
2026-09-26 01:37:16 +00:00
sudo nft list table ip nat #| sudo tee /etc/nftables/port-forwarding.nft