Hello, i'm facing an issue with iptables not forwarding packets.
the policy is ACCEPT on all tables for filter.
sudo iptables --policy INPUT ACCEPT
sudo iptables --policy OUTPUT ACCEPT
sudo iptables --policy FORWARD ACCEPT
the only command i need to make SNAT is the following:
sudo iptables -t nat -A POSTROUTING --out-interface enp0s3 -j MASQUERADE
the above is not working, unless i execute the following:
sudo sysctl -w net.ipv4.ip_forward=1
after some search i did, this command executes packet forwarding on the kernel level.
Is this the proper way ?? supposly iptables could have handled that as a network package.
Also i have another issue, the -A (append) of the iptables command, is lost after restart.
Any guidance will be much appreciated.
the policy is ACCEPT on all tables for filter.
sudo iptables --policy INPUT ACCEPT
sudo iptables --policy OUTPUT ACCEPT
sudo iptables --policy FORWARD ACCEPT
the only command i need to make SNAT is the following:
sudo iptables -t nat -A POSTROUTING --out-interface enp0s3 -j MASQUERADE
the above is not working, unless i execute the following:
sudo sysctl -w net.ipv4.ip_forward=1
after some search i did, this command executes packet forwarding on the kernel level.
Is this the proper way ?? supposly iptables could have handled that as a network package.
Also i have another issue, the -A (append) of the iptables command, is lost after restart.
Any guidance will be much appreciated.
Statistics: Posted by Bambos — 2024-07-03 13:08 — Replies 0 — Views 27