-
openvpn / iptables
Every time I restart my openvpn server, I need to manually type the following command, so that the VPN clients can see other devices on the remote network.
Code:
iptables -t nat -A POSTROUTING -s 10.8.0.0/24 -o eth0 -j MASQUERADE
Is there anything I can set so that it will remember this setting, or is the only option to just add it to a startup script or something
-
-
I do Code:
iptables-save > /etc/iptables.save
and then in rc.local (earlier would be better, but I'm lazy)
Code:
iptables-restore < /etc/iptables.save
-
shorewall really is iptables made easy
Shoreline Firewall
-
Quote:
Originally Posted by
kmount
iptables-save ?
Is that all i need to do? hah, this has been bugging me for about a year. ..
powdarrrmonkey, Is that necessary or will kmonts suggestion do?
Cybernerd, I dont even use iptables as a firewall, i just found that the only way to do what I wanted with openvpn was to envoke that command...
-
On gentoo, you should be able to use /etc/init.d/iptables save which will dump it into /var/lib/iptables/rules-save and then when /etc/init.d/iptables start is ran on boot up it should load them back as below.
Code:
/etc/init.d/iptables save
* Saving iptables state
/etc/init.d/iptables stop
* Saving iptables state
* Stopping firewall
/etc/init.d/iptables start
* Loading iptables state and starting firewall
-
I thought there might be some gentoo magic.
@RB: it's the same thing: iptables-save just spits out a machine-interpreted dump of the current state. You have to put it somewhere though.
-
thanks very much for your help... I think I must owe you both a crate of beer for all the continued help :D
-
Sounds like a plan :thumb:
-
I'm a tennants man; remember that when you're next home ;)