RabbieBurns Posted August 4, 2009 Posted August 4, 2009 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. 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
powdarrmonkey Posted August 4, 2009 Posted August 4, 2009 I do iptables-save > /etc/iptables.save and then in rc.local (earlier would be better, but I'm lazy) iptables-restore < /etc/iptables.save 1
CyberNerd Posted August 4, 2009 Posted August 4, 2009 shorewall really is iptables made easy Shoreline Firewall 1
RabbieBurns Posted August 4, 2009 Author Posted August 4, 2009 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...
kmount Posted August 4, 2009 Posted August 4, 2009 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. /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 1
powdarrmonkey Posted August 4, 2009 Posted August 4, 2009 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. 1
RabbieBurns Posted August 4, 2009 Author Posted August 4, 2009 thanks very much for your help... I think I must owe you both a crate of beer for all the continued help
kmount Posted August 4, 2009 Posted August 4, 2009 I'm a tennants man; remember that when you're next home
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now