Jump to content
Not connected, Your IP: 3.133.147.87
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

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
  • Security Check
    Play CAPTCHA Audio
    Refresh Image
Sign in to follow this  

×
×
  • Create New...