**VIDEO GUIDE** How to setup a virtual VPN router to route any device through a vpn


Recommended Posts

  • 2 weeks later...
  • 1 month later...

Saw  this on youtube and wanted to give it a try. Ran through all the steps with ease but ran into one issue.   After everything was setup running through the VPN with no DNS leaks detected rebooting the VM would break everything.  Took me a while to figure it out but finally found that on reboot, the VM could not resolve the DNS of the VPN host.  It's couldn't resolved any DNS for that matter.  nslookups would fail.  

 

I imagine this is due to the dns leak fix that sets the dns from the vpn tunnel, but because the vpn tunnel cannot be established the dns is never set.  

 

Not sure if this was the right was to do this or not but this is what I did.  

 

sudo nano /etc/resolvconf/resolv.conf.d/base

#Add the following line - mine was balnk, adjust ip for ip of your VM.

nameserver 192.168.1.254 

Crtl+O, Enter, Ctrl+X

 

Then, 

sudo nano /etc/network/interfaces

#Adjust dns--nameservers to the following - adjust ip for ip of your vm

dns-nameservers 192.168.1.254

Crtl+O, Enter, Ctrl+X

 

sudo reboot

 

Then ifconfig to check the tunnel was up, nslookup google.com to ensure DNS was working.  And finally checked PIA to show I was connected through tunnel and http://dnsleak.com/ to make sure no dns leaks were detected.  

 

Not sure why this happened or if I missed something in the tutorial or even if this is the right way to fix it but it worked for me.  Maybe someone with a little more knowledge on the topic can comment on this. @gridrunner you following this thread still?  

 

Also on a side note, removing the dnsmasq package and rebooting brought everything back up but the DNS leak still persisted.  Reinstalling dnsmasq would then correct the dns leak if I remember right (it's late) but then on reboot it would all quit again.  

 

I plan on adjusting the DCHP service on my pfsense box tomorrow to hand out the gateway and DNS of the VPN VM so everything connected to my network is routed through the tunnel to see how it goes.  The nice thing then is everything is included in the VPN tunnel by default, but if I want to exclude a device, I just set a static ip with the gateway and DNS from my pfsense box to bypass the tunnel.  That is the thought anyway. 

 

Hope this helps if anyone else tries this out and runs into the same problem.  

 

Also, it would be awesome to see something like this as a docker image.

 

And gridrunner, keep up the amazing videos.  I think I have watched most more than once!!!   

 

 

Link to comment
  • 3 months later...
  • 6 months later...

Hi spaceinvader one,

 

I followed your guide and my proxy is working flawlessly. Great instructional video.

 

Quick question: What ports do I use when forcing a web browser through the router's ip?

 

For example, I want to use Vivaldi has my VPN protected web browser on my desktop. I downloaded several extensions and I can't seem to get any of them to work.

 

I'm using the IP we set up as our virtual router, which works perfectly when applied in my Windows IPV4 settings for my entire desktop.

 

1) Does it have something to do with the specific ports I'm trying  to use? Most extensions want HTTP, HTTPS, FTP ports, and the default ones do not work properly.

 

2) How do I point specific dockers to this VPN Router's address for VPN protection? Google searches yield "you can't use different IP address per each Unraid Docker".

 

Thanks again ?

 

 

 

 

Edited by bmilcs
Link to comment
  • 1 year later...

Hey guys,

I have been using this and it's been working perfectly. But I recently switched from PIA to Mullvad and I Cannot get this to work. I updated the username and password and moved the new mullvad config files to the new directory, but just can't get this to work. Can someone help me out please?

Link to comment
  • 2 weeks later...
On 12/9/2019 at 6:38 AM, maxse said:

Just couldn’t get this working. 
looks like I’ll have to spend some money and buy a router that could do vpn. Really sucks that I can’t get mullvad to work with this especially since it’s also openvpn Supported.

no one is using it huh?

 

My suggestion if you're spending money on a new router is get a small embedded PC and run pfSense on it. You will get a much more flexible solution than any out of the box router.  I use the built in pfSense VPN client to route specific traffic via Mullvad VPN, and also use the Mullvad port forwarding feature.

 

I have one of these, in a case, cost about USD100

https://pcengines.ch/apu2.htm

 

Anything with 2 NIC's will do though really.  PC Engines have a bunch of options https://www.pcengines.ch/newshop.php?c=4

 

There's also a bunch of pfSense provided options https://www.pfsense.org/products/ - the SG1100 is pretty good value at $179.

 

Mine gets its internet via an old ADSL2 modem in bridge mode (hopefully by fibre box soon!).  I just use my old router as a Wifi access point, but you could get something fancier like UniFi or Google Wifi.  The point is each device (Modem/NTU, Wifi AP, Router) does something specific very well, and then you can individually upgrade them if needed.

 

You can also run pfSense in a VM if you want to test it out, but I think it's better for your internet access to be independent of your unraid server.

 

 

Edited by jammin
Link to comment

GOT IT WORKING! Thanks so much spaceinvaderone! You are THE man!

It was a different port that I need to open (part of the iptables commands) 1197 and not 1198.

I did accidentally open the PIA port by copy and pasting your commands before realizing I needed different port.

But I don't know how to close the PIA one that I opened. Do I need to worry about this? Or does it get closed on reboot sicne I saved the new iptables, after correcting it? @SpaceInvaderOne

 

Also, I am still getting a DNS Leak when tested on the web site. and those last 2 lines of code to the conf file were already a part of the mullvad conf file. Should I be concerned about this? I don't know why it's still showing that my DNS is leaking

 

*EDIT*

BTW, in order to save this exact vm and setting, I can just use the CA backup plugin I've been using and just select a destination for libvert.img correct?

 

This is amazing, thank you so much!

Edited by maxse
Link to comment

Hi @maxse I am glad that you got it all working with mulvad

If you want to backup the vm. Manually backup the vdisk for it that you will find in the domains share   /mnt/user/domains

The libvirt image just contains the xml for the vm not its 'contents'

 

I will be making a new video for a virtual router that will be much easier to configure very soon. :)

Link to comment
  • 2 months later...
On 12/12/2019 at 12:09 PM, SpaceInvaderOne said:

Hi @maxse I am glad that you got it all working with mulvad

If you want to backup the vm. Manually backup the vdisk for it that you will find in the domains share   /mnt/user/domains

The libvirt image just contains the xml for the vm not its 'contents'

 

I will be making a new video for a virtual router that will be much easier to configure very soon. :)

How soon is soon!? I'm very very excited for that. I'm struggling with this now as I think a few things have changed. Can't wait!

Link to comment
23 hours ago, SpaceInvaderOne said:

Hi @NoxeyI have a couple of videos i must finsish first. But i will try and make it for the end of the month. Send me a pm towards the end of the month to remind me :)

Fantastic. Thank you, can't wait! I'm currently struggling to adjust the .conf file as I think things have changed since your initial video. Having issues getting it to work. 

 

Thanks for your response and all of your videos. You're fantastic. 

 

  • Like 1
Link to comment
  • 4 weeks later...
On 3/9/2020 at 2:22 PM, SpaceInvaderOne said:

Hi @NoxeyI have a couple of videos i must finsish first. But i will try and make it for the end of the month. Send me a pm towards the end of the month to remind me :)


Thanks for this as well. I was having issues getting this version up and running and was wondering if there was another way to do this. Found this thread and am happy to see an update/rework is coming!

Link to comment
  • 3 weeks later...
  • 2 months later...
On 3/9/2020 at 2:22 PM, SpaceInvaderOne said:

Hi @NoxeyI have a couple of videos i must finsish first. But i will try and make it for the end of the month. Send me a pm towards the end of the month to remind me :)

Hey there! Did you ever make this updated video? I can't seem to find it on your profile. Now that NBA is back I want to put my Apple TV on a VPN in Ireland to make it easier to watch games!

Link to comment

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.   Restore formatting

  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.