Jump to content
Not connected, Your IP: 18.221.68.196

Recommended Posts

Hi,

 

I writed the following python script to connect to Airvpn and update DNS accordingly, etc. It is the first version and I did it mostly to practice a python (also now I'm not able to run eddie on gnome).

 

Any feedback just let me know, also if you have suggestions on how to do things better in python.

 

here the link: https://github.com/machavez84/airvpnConnect

 

Please read theREADME.me file.

 

Regards.

Share this post


Link to post
def findDNS(file):
  dns = ""
  if "443" in file and "UDP" in file:
    dns = "10.4.0.1"
  elif "443" in file and "TCP" in file:
    dns = "10.5.0.1"
  elif "80" in file and "UDP" in file:
    dns = "10.6.0.1"
  elif "80" in file and "TCP" in file:
    dns = "10.7.0.1"
  elif "53" in file and "UDP" in file:
    dns = "10.8.0.1"
  elif "53" in file and "TCP" in file:
    dns = "10.9.0.1"
  elif "1194" in file and "UDP" in file:
    dns = "10.30.0.1"
  elif "1194" in file and "TCP" in file:
    dns = "10.50.0.1"
return dns

Shorten it; set 10.4.0.1 in all cases. Will still work.

 

def getRemoteHost(file):
  remote = ""
  if "AltEntry" in file:
    remote = "earth2.vpn.airdns.org"
  else:
    remote = "earth.vpn.airdns.org"
return remote

Expand this with a user prompt for a server or a geographic area, utilizing techniques in How can I get VPN servers IP addresses?.

 

Then give it a ncurses UI and incorporate the ability to add custom OpenVPN directives. Then implement Network Lock. Behold, an Eddie alternative. Don't listen to me, though

 

Nice work.


NOT AN AIRVPN TEAM MEMBER. USE TICKETS FOR PROFESSIONAL SUPPORT.

LZ1's New User Guide to AirVPN « Plenty of stuff for advanced users, too!

Want to contact me directly? All relevant methods are on my About me page.

Share this post


Link to post

Hehe, thanks Treiberschreiber,

 

I will enhance it if I have time. Just removed the chattr over /etc/Resolv.conf. I was setting the immutable flag because raspbian jessie was overwriting the file every time.

 

For the FindDNS() I just followed this rules --> https://airvpn.org/specs/

 

Regards.

Share this post


Link to post

For the FindDNS() I just followed this rules --> https://airvpn.org/specs/

 

Yes, everyone finds this one. Staff once mentioned that the same DNS server is listening on all 10.x.0.1 addresses, so in the end I made my life easier and started using static 10.4.0.1 exclusively. This way I also avoided DNS request leaks entirely. On Windows, I needed to write a script to reenable DHCP DNS if I wanted or needed a break from the VPN.

 

On GNU/Linux it's even easier. I've got two network profiles set up in network-manager. One is DHCP and one is DHCP + AirDNS only. No leaks with the second one. Changing is also easier than ever. I love Linux.


NOT AN AIRVPN TEAM MEMBER. USE TICKETS FOR PROFESSIONAL SUPPORT.

LZ1's New User Guide to AirVPN « Plenty of stuff for advanced users, too!

Want to contact me directly? All relevant methods are on my About me page.

Share this post


Link to post

Hi guys,

 

I'm interested in writing a Python script for Windows that allows me to connect / disconnect AirVPN and connect to specific servers... could anybody elaborate on the general, top level approach here ?

 

So, it appears we cannot control the Eddie GUI client via Python, so we connect to an AirVPN server by creating a .ovpn file ?

 

Where would I get the .ovpn file that the script posted by machavez is asking for ?

 

Thanks.

Share this post


Link to post
Guest
This topic is now closed to further replies.

×
×
  • Create New...