How to only allow OpenVPN connections with IPtables ?
Hello, I'd like to configure IPtables to make sure I can only access the internet through an openvpn connection (so when the connection is down I have no way to access the internet but to connect to the vpn again).
I know how to do this with Firestarter (restrictive outgoing policy and I only allow the vpn server IPs) but Firestarter seems to be stupid : for some reason eth0 was changed to eth1 and Firestarter can't work properly anymore, even though that probably can be fixed with Firestarter I'm no more interested in this program and I'd better like to know how to apply the same policy using IPtables.
I've tried a few things already but it failed each time ... how can I effectively allow my computer to connect to the VPN while everything else is blocked ?
My current set of rules :
# Generated by iptables-save v1.4.10 on Mon May 23 18:02:08 2011
:INPUT ACCEPT [0:0]
:FORWARD ACCEPT [0:0]
:OUTPUT ACCEPT [0:0]
-A INPUT -i lo -j ACCEPT
-A INPUT -i tun+ -j ACCEPT
-A INPUT -m conntrack --ctstate RELATED,ESTABLISHED -j ACCEPT
-A INPUT -s xx.xxx.xx.xx -j ACCEPT
-A INPUT -j DROP
-A OUTPUT -o tun+ -j ACCEPT
-A OUTPUT -d xx.xxx.xx.xx -j ACCEPT
-A OUTPUT -j DROP
# Completed on Mon May 23 18:02:08 2011
What should I change ?