how to make config persistent on server when reboot ?
Posted: Sun Apr 07, 2013 4:40 pm
hi, new to openvpn ,
i tried to install on windows xp openvpn, but seems to have problems with routing to tunneling web trafic through vpn..;
so i decided to run Openvpn server on my ubuntu 12.04 LTS
everything seems to be ok : i can ping, i can tunneling web trafic through vpn (i can see it with my public ip witch is the same than public ip of the server ) !
but the problem is the following one :
when i reboot the pc where my openvpn is, i lose my rules to redirect web trafic to vpn (ping is good , but no tunnel for web)
so i have to write the rules manually :
sudo sh -c 'echo 1 > /proc/sys/net/ipv4/ip_forward'
net.ipv4.ip_forward = 1
sudo iptables -t nat -A POSTROUTING -s 10.8.0.0/24 -o eth0 -j MASQUERADE
i restart openvpn server, and now it works ! (web trhough vpn is ok )
but if reboot pc with openvpn server installed, it is lost and i have to restart ...
so i do this :
sudo sh -c "iptables-save > /etc/iptables.rules"
put this line after if lo inet loopback
"pre-up iptables-restore < /etc/iptables.rules "
and it doess'nt work
why on my iptables rules i haven't got my interface eth0 ??
where is the mistake ??
please !
thanks for your help !!!
i tried to install on windows xp openvpn, but seems to have problems with routing to tunneling web trafic through vpn..;
so i decided to run Openvpn server on my ubuntu 12.04 LTS
everything seems to be ok : i can ping, i can tunneling web trafic through vpn (i can see it with my public ip witch is the same than public ip of the server ) !
but the problem is the following one :
when i reboot the pc where my openvpn is, i lose my rules to redirect web trafic to vpn (ping is good , but no tunnel for web)
so i have to write the rules manually :
sudo sh -c 'echo 1 > /proc/sys/net/ipv4/ip_forward'
net.ipv4.ip_forward = 1
sudo iptables -t nat -A POSTROUTING -s 10.8.0.0/24 -o eth0 -j MASQUERADE
i restart openvpn server, and now it works ! (web trhough vpn is ok )
but if reboot pc with openvpn server installed, it is lost and i have to restart ...
so i do this :
sudo sh -c "iptables-save > /etc/iptables.rules"
put this line after if lo inet loopback
"pre-up iptables-restore < /etc/iptables.rules "
and it doess'nt work
why on my iptables rules i haven't got my interface eth0 ??
where is the mistake ??
please !
thanks for your help !!!