iptables rule to allow all outbound locally originating traffic?
You need two rules to do that:
iptables -I OUTPUT -o eth0 -d 0.0.0.0/0 -j ACCEPT
iptables -I INPUT -i eth0 -m state --state ESTABLISHED,RELATED -j ACCEPT
Some notes.
- Preexisting rules that you may have may do this already, but look different.
- This uses
-I
to force these rules to be first.iptables
rules are evaluated top down. - The
-o
and-i
flags mean "out" and "in" respectively. Replaceeth0
with the proper ethernet interface name.