vmlxnetwork I added the following iptables rule: iptables -t nat -A POSTROUTING -s 10.8.0.0/24 -o eth0 -j MASQUERADE I check the result with this command: iptables -L -t nat result: Chain POSTROUTING (policy ACCEPT) target prot opt source destination MASQUERADE all -- 10.8.0.0/24 anywhere However, when I restart the host with init 6, this rule no longer shows up in "iptables -L -t nat". Also, openvpn stops working. Any ideas on how to make this rule permanent?
maikcat in centos there is a script called iptables-save which creates /etc/sysconfig/iptables file which is readed by init.d script called iptables... you can edit yourself the file directly Michael.
vmlxnetwork Centos 6: service iptables service iptables status service iptables save Debian 6: use iptables-save to save your rules to a file somewhere in /etc/, then in a up line in /etc/network/interfaces use iptables-restore to restore rules from that file iptables-save iptables-restore sudo sh -c "iptables-save > /etc/iptables.rules" vi /etc/network/interfaces auto eth0 iface eth0 inet dhcp pre-up iptables-restore < /etc/iptables.rules
mwandelaar And, for both distro's, don't forget to put ip-forwarding on at boottime: echo "net.ipv4.ip_forward=1" >> /etc/sysctl.conf