Jump to content
Not connected, Your IP: 216.73.217.99
Sign in to follow this  
icarus_8353

Trouble setting iptables rules for AirVPN

Recommended Posts

Hello,

​

​I've been using your VPN service for a while now and now I want to set iptables rules so that when AirVPN disconnects for any reason all traffic will be dropped and the real IP address will not leak.

​

​I've looked at this topic: https://airvpn.org/topic/9139-prevent-leaks-with-linux-iptables/

 

​I'm using the AirVPN client on Linux and my network interface is wlan0. Using these rules I want to connect to Phoenicis.

​The entry IP address for Phoenicis should be: 109.163.230.232

​I am using protocol UDP, port 443 for connecting to the VPN.

​

​Now here are the iptables rules I've set, I managed to make it so all internet traffic stops when disconnected from the VPN. However I can't reconnect to Phoenicis, no traffic is flowing. What am I doing wrong? Here are the iptables rules:

​

iptables -A INPUT -i lo -j ACCEPT
iptables -A OUTPUT -o lo -j ACCEPT
iptables -A OUTPUT -d 255.255.255.255 -j ACCEPT
iptables -A INPUT -s 255.255.255.255 -j ACCEPT
iptables -A INPUT -s *IPv4 address here*/16 -d 192.168.0.0/16 -j ACCEPT   # replace *IPv4 address here with your local IPv4 IP address*
iptables -A OUTPUT -s *IPv4 address here*/16 -d 192.168.0.0/16 -j ACCEPT   # replace *IPv4 address here with your local IPv4 IP address*
iptables -A FORWARD -i wlan0 -o tun0 -j ACCEPT
iptables -A FORWARD -i tun0 -o wlan0 -j ACCEPT
iptables -t nat -A POSTROUTING -o tun0 -j MASQUERADE
iptables -A OUTPUT -o wlan0 ! -d 109.163.230.232 -j DROP   # 109.163.230.232 is the entry IP address for Phoenicis

​When I set these rules during connection everything works. However when disconnect and try to reconnect to the VPN again no traffic will flow. Please help, thanks.

Share this post


Link to post

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×
×
  • Create New...