Creating a VPN with Proxmox

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
[Music] here we go [Music] hello everyone so today i'm going to be demonstrating how to create your own vpn um i know there's a lot of vpn software's out there that are like nordvpn or expressvpn that you do have to pay for but i'm going to be demonstrating how you can get your own vpn service for absolutely free as long as you have the capabilities to host it on your own local machine so for starters what we're going to do is we're actually going to download and a software to your computer so the software you're going to download is openvpn connect download just go ahead and search that in the google search bar you're gonna click on this first link right here that's um to openvpn.net okay so once you're here you're going to just scroll down and click right here where it says download open vpn connect version three you're gonna go ahead and download this right here once downloaded you're gonna go ahead and see it pop up on your desktop right here it's also gonna be available down here in your queue so you'll see openvpn connect disconnected right here okay so once you open openvpn right here you're going to be prompted with this you can either put in a url right here to connect to a vpn or you can connect a oh a ovpn file right here so the whole purpose of this video is i'm going to actually be showing you how to get your own ovpn file on your local server or your local hardware i'll be showing you how to do that now okay so once you are loaded up right here we're gonna go ahead and do this through proxmox i have proxmox version 7.1-7 as you can see up here um the first thing i'm going to want to do is i'm going to want to go ahead and go to your local file system you're going to go to your local file system go to ct templates and then you're going to want to go to templates and you're going to want to download a specific template you're going to want to download the ubuntu 18.04 standard edition right here you're going to want to download this one onto your templates once that's downloaded you can click up here on create ct so now you can go ahead and give it whichever name you prefer for this one i'm going to go ahead and name it vpn you're going to come over here and you're going to set a password okay once the password is set you're going to go over to template you're going to go ahead and pick your template which is the 18.04 the disk size is fine you can leave it as it is by default cpu is fine by default and memory is fine at 512. so once you get to the network you can either choose to set you a static ipv4 address or you can just do dhcp for the purpose of this demonstration i'm going to go ahead and use dhcp under dns settings just to verify and to make sure that you're going to be able to obtain the downloads and the updates um within your virtual machine you're going to want to set the dns settings to google's so google's dns is 8.8.8.8 and then 8.8.4.4 go ahead and press next so once you get to the screen make sure you do not check this box right here that says start after created because you're actually going to want to put in some commands right after this so you don't want the container to spin up as soon as it's done so just leave that unchecked and go ahead and click finish now we're going to let this go ahead and create so just go ahead and press the x so once you've closed out of there now you can go over here to where it says proxmox you can click on proxmox or for most people by default it should say pve i do have mine set to say proxmox or whatever your node is just go over to your node and then click on shell once you're in shell you're going to go ahead and put in this first command so the first command is it's going to be cd forward slash etc forward slash pve forward slash lxc press enter right here you can do an ls and this is just to list the current containers you have so you can see 101 is the container we just created so from here what you're actually going to want to do is you're going to want to do nano and then do the container number and then press tab and then press enter once you're into nano you're going to scroll all the way down to the very bottom and you're going to go ahead and put these two lines of code both of these lines i will have in the description of the video below so just go ahead and look out for those once you have those inputted you're just going to hit control x y to save and then press enter okay now once you're here you're going to go ahead and run this next command and again this will be in the description of the video so once you have run this ch own command just to verify that it did work you're going to go ahead and run this next command right here which is ls space dash l space forward slash dev forward slash net and forward slash ton once you press enter you should see an output that looks exactly like this the date you don't have to worry about that because depending on the time that you do this exact step this date will be different but as long as these beginning parts right here are the exact same of the output once you've done this you're good to go go ahead and click over here under your container once you click on your container you can click on console and then go ahead and start up your container okay so once your container has started up you're just going to enter root as the login your password is going to be the password that you created during setup okay and now the first step that you're going to do inside of the container is you're actually going to want to run an update and an upgrade so the command for this is apt update and upgrade so you can see here there's an app update and and app upgrade dash y the dash y just auto prompts it to say yes to pretty much all updates okay so once your system is completely up to date um you can just double check and triple check it's pretty simple all you got to do is just run the command one more time by running the command one more time you just press enter and you can see here right now it's reading all packages and it says all packages are up to date so that's exactly what we want to see so now once you get this message after updating now we can move on to the next step so the next step in the process is going to be putting in this command so now the command you're going to put in is right here you're going to put in a okay so the next command you're going to put in is apt install openvpn space git so what this is going to do is it's going to install openvpn and git and you can see here that i did not put the dash y so it is now prompting me saying do you want to continue yes or no so we're going to go ahead and press yes now we're going to go ahead and let this install open vpn as well as install git alrighty so now once that is completed now you're gonna go ahead and run this next line which is the get clone line once you go ahead and copy that and just paste this in alrighty once that's done go on to the next line which is open vpn install so now we're going to be just traveling to the directory okay so now we are under the directory of openvpn install now we're going to just run the bash script so now this exact script that i'm about to run it can be run every single time that you want to create a new client for your vpn so right now in this exact instance we're going to be doing our very first client but note that after this first client creation if you want additional clients just run this bash script again and again as many times and as many clients as you need to access your vpn service okay so now we get welcome to this first prompt which asks me to verify that this is my public ipv4 address so we're going to go ahead and press enter right here it is prompting me to use which protocol udp or tcp we're going to go ahead and put one for udp press enter now what port do you want to use for openvpn to listen to now port 1194 is the default but i will let you know that most and pretty much majority of isps they do block port 1194 this is only due to the fact that most isps did not want you to use a vpn so most of them do block this port so for me i'm going to use my own specific port that i want to use that is completely different from 1194 and then you get prompted to select your dns server for this one we're just going to go ahead and go with cloudflares which is 1.1.1.1 so we're going to input three press enter and then we're going to go ahead and enter a name for our first client so we're just going to put laptop for this one and now we just press any key to continue so now once you get to this part it does say finished the client has been created so you can see here the client configuration is available in root so new clients can be added by running the script again so what you want to do from this prompt it's really simple to get back to root really all you want to do is just do a cd and press enter now from here you can do an ls right there you can see open openvpn install and then you can also see laptop.ovpn so this is actually the client that we just created so in order to actually access this client this is pretty much the very most important part that you're going to have to do so what you're going to have to do is you're going to have to actually do cat and then the name of the client and then press enter so you're going to scroll up and you're gonna see right here where we left off or i inputted cat right here starting at the very first line which says client you're gonna just highlight from here all the way down all the way right before the new line and go ahead and copy all of this go ahead and open up a new text document or a new notepad go ahead and paste this into the notepad then you're going to do a file save as and we're going to go ahead and put this into my documents we're going to make a we're going to go ahead and actually put this into the vpn folder under vpn now you're going to just go ahead and put save as all files and we're going to go ahead and name this laptop and you're going to put dot ovpn and then go ahead and press save go ahead and close out of the text box now we're going to go ahead and minimize everything and we are going to go ahead and open the open vpn connect once here you're going to click on browse and then you're going to travel over to that file that you created go ahead and load up that file in now the profile name we will just change this to laptop server host name you can leave it alone this is pretty much your public ip go ahead and press connect now once you've gotten here and you have your profile all set up before you connect it there is one more crucial point to get at to actually access this vpn and that is to actually go into port forwarding so port forwarding is going to be different for everyone and everyone's router i can't really do an exact explanation on how you would port forward your router but what i can tell you is basically you're just going to go to the internet and you're going to put into your google search bar you're going to put in your gateway of your router once you have your router's gateway inputted you will be opened up with your router login screen so you're going to want to just go ahead and log into your router's credentials now once you're in for me and my purpose um it's actually gonna be under this firewall tab up here so you're gonna go to firewall and then virtual servers usually it'll be under like virtual servers or like port triggers or even port forwarding just whatever really says port forwarding once you're under here you're going to go ahead and set it up so to find the actual ip address if you were like me and went ahead and use dhcp what you're going to want to do let me go ahead and clear this once you are in the server all you have to do is really just type in ip address and once under the ip address you can see the ip of the server right here so this is the actual ip address of the server that you're going to use to port forward so and put this ip address along with the port you specified and you're good to go from there alrighty so now that you have port forwarded your router now you can simply just toggle on your vpn okay and now you can see here that i am successfully connected to my vpn so it has actually assigned me a private ip right here and this is also the server and public ip address down here along with the port number and all this very crucial information so but you can see right here your private ip is now showing at 10 8 0 2 so now just to show you the main purpose of why you would want to do this i'm going to go ahead and turn this off and as you can see here i am currently connected to my home wi-fi okay so my cell phone is popped up right here i'm gonna go ahead and connect to my cell phone so now my cell phone is connected and i will show you here that if i am on a simple google tab on my local hotspot as you can see here i'm on my iphone now if i go to my proxmox server my proxmox server will not load it will just sit here probably have a 404 error there you go site cannot be reached so now what you're going to do is you're going to go and hit open vpn toggle this on once this connects now we're going to go ahead and refresh this page and you can see here now i am successfully connected back into my home server so this is my home server located at my house and as you can see by down here i am still connected to my iphone but i am also at the same time running my vpn that is on my proxmox server so my vpn on my proxmox server is allowing me to access everything on my home network even if i'm not at home so um i just like to thank everybody for watching my video just remember like comment subscribe have a great day [Music]
Info
Channel: Homelab Tim
Views: 22,782
Rating: undefined out of 5
Keywords:
Id: m4i_kkx50lw
Channel Id: undefined
Length: 17min 28sec (1048 seconds)
Published: Sat Jul 30 2022
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.