iptables configuration under ubuntu
Posted
by aioobe
on Server Fault
See other posts from Server Fault
or by aioobe
Published on 2010-05-11T20:21:59Z
Indexed on
2010/05/11
20:25 UTC
Read the original article
Hit count: 295
I'm following a tutorial on setting up a dns-tunnel.
I've run into the following instruction:
Now you need to enable forwarding on this server. I use iptables to implement masquerading. There are many HOWTOs about this (a simple one, for example). On Debian, the configuration file for iptables is in /var/lib/iptables/active. The relevant bit is:
*nat
:PREROUTING ACCEPT [6:1596]
:POSTROUTING ACCEPT [1:76]
:OUTPUT ACCEPT [1:76]
-A POSTROUTING -s 10.0.0.0/8 -j MASQUERADE
COMMIT
Restart iptables:
/etc/init.d/iptables restart
The problem is that I don't have any /var/lib/iptables/active
. (I'm on ubuntu.)
How can I accomplish this? I suspect that I should just interact with the iptables
command somehow but I have no clue what to write. Best would probably be if I could put the commands in a script somehow I suppose.
(A side-note. If I execute a few iptables
-commands it wont be there for ever, right? The rules will be discarded on reboot?)
© Server Fault or respective owner