Jump to content
Not connected, Your IP: 35.153.166.111
rootinthemood

How to exclude programs from AirVPN (Eddie + Network lock + firejail) in Linux

Recommended Posts

Posted ... (edited)

It seems i can't post in How To so I'll post here.
 

In this tutorial I will explain how to exclude individual programs while connected via the Eddie client and have the network lock active. I wanted to run steam without VPN so my latency was low for some competitive gaming, while my whole system was still connected and locked. For this to work we need firejail. Firejail can sandbox individual programs on it’s own with a lot of parameters.
 

Install firejail first.

 

We want a clean firewall state so disable network lock and flush the firewall.
To check it's clean run:

sudo iptables -nvL

 

If not clean run:

sudo iptables --flush

 

Now we want to save this state to a file.

sudo iptables-save -f /etc/firejail/iptables-save

 

You can now network lock again.

 

Make a bash script.

#!/bin/bash

firejail --noprofile \
--net=your_main_ethernet_interface \ 
--ip=ip_address_in_your_routers_subnet \
--defaultgw=router_ip \
--dns=dns_server_of_your_choice \
--dns=dns_server_of_your_choice \
--netfilter=/etc/firejail/iptables-save \
program_you_want_to_run

Save in /usr/bin/ and make executable.

chmod +x program

 

You can now run the bash script and your program will be excluded from the VPN and network lock.

Check with firejail --top to see if it is “jailed”.

You could also replace program_you_want_to_run  with $1 and name the script novpn or so. This would make it a lot more versatile. As you can now pas an argument with the script like so:

novpn firefox
novpn thunderbird
novpn steam-runtime

 

If you want to avoid a bash script and you want to directly run your program with firejail follow along.
This means if you run (in my case) steam-runtime directly, it will be firejailed.
If you do this you can delete the above bash script you made.

 

cp /usr/share/doc/fireail/profile.template  ~/.config/firejail/ 


Rename it to your_program.template

your_program should match the executable name you want to run. In my case steam-runtime.

 

Edit the file and comment out every include you see, so everything is commented out. And paste the text below as you see fit. Somewhere around “net” stuff would be my choice.
 

net your_main_ethernet_interface  
ip ip_address_in_your_routers_subnet 
defaultgw router_ip
dns dns_server_of_your_choice 
dns dns_server_of_your_choice 
netfilter /etc/firejail/iptables-save 

 

Make a symbolic link

 

sudo ln -s /usr/bin/firejail /usr/local/bin/your_program

 

And that’s It. Every time you run your_program it will be firejailed and outside of the vpn.

Check with firejail --top.

Edited ... by rootinthemood

Share this post


Link to post

That's actually something I wanted to test myself for some time now. Never got to experiment with that, so I'm glad there's a guide now. :D Thank you very much for the effort.
 

1 hour ago, rootinthemood said:

It seems i can't post in How To so I'll post here.


No one can post there. It's a section for tried and tested guides. Yours will be put there once people and AirVPN Staff successfully test it. :)

» I am not an AirVPN team member. All opinions are my own and are not official. Refer to Staff postings for the official word.

» These are the community forums, not the support portal. You're writing with other users here.

» New here? LZ1's New User Guide to AirVPN. Use the search function, Luke!

» Tor exits behind a VPN connection are discouraged. Using Tor on the other hand is not.

 

» Privacy is like alcohol: Drink a little and it can help you stay unnoticed. Drink a lot and everyone will notice you.

» I cannot give you the solution to all your issues. But I can guide you to it. The rest is up to you.

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

×
×
  • Create New...