Skip to content

Container that connects to a vpn and acts as a default gw

Notifications You must be signed in to change notification settings

Gnitset/vpn-defgw

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 

Repository files navigation

To use with nordvpn:

  1. Create vlan 8 in you switches/accesspoints/whatever
  2. Create the subnet for the clients and attach it to vlan 8 docker network create -d macvlan --subnet=10.11.8.0/24 --ip-range=10.11.8.0/28 -o parent=eth0.8 vpnvlan
  3. Go to https://nordvpn.com/servers/tools/ and pick a server that supports openvpn
  4. Download the config for OpenVPN UDP and save it as config.ovpn
  5. Edit the downloaded config and replace the line auth-user-pass with auth-user-pass /cred
  6. Put you username and password in a file called cred, username on the first line and password on the second
  7. Build the container with docker build -t vpn-defgw .
  8. Run the container with docker run -dit --cap-add=NET_ADMIN --name vpn-defgw vpn-defgw
  9. Attach vlan 8 to the container docker network connect vpnvlan vpn-defgw

To change vlan, change eth0.8 to eth0.<vlan_id> in the command above

To change ip-network you have to replace it in the command above and in the files run and udhcpd.conf

To use with different vpn provider:

  1. Make sure the provider supports openvpn
  2. Replace dns-servers in udhcpd.conf
  3. Do rest of the steps from nordvpn

About

Container that connects to a vpn and acts as a default gw

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published