Last active
April 25, 2022 05:07
-
-
Save niksmac/e6d83c243deb92f02b01b236a97a1f8f to your computer and use it in GitHub Desktop.
Revisions
-
niksmac revised this gist
Sep 23, 2021 . No changes.There are no files selected for viewing
-
niksmac created this gist
Sep 23, 2021 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,16 @@ Set the rules ``` sudo iptables -A INPUT -i eth0 -p tcp --dport 80 -j ACCEPT sudo iptables -A PREROUTING -t nat -i eth0 -p tcp --dport 80 -j REDIRECT --to-port 3000 ``` On Ubuntu: `sudo apt-get install iptables-persistent` After that, run next commands every time you want save iptables changes permanently: ``` sudo netfilter-persistent save sudo netfilter-persistent reload ```