VLAN Inside Virtual Box Using OpenVPN__BDK_Documentation5
description
Transcript of VLAN Inside Virtual Box Using OpenVPN__BDK_Documentation5
![Page 1: VLAN Inside Virtual Box Using OpenVPN__BDK_Documentation5](https://reader034.fdocuments.us/reader034/viewer/2022051316/55cf8fe7550346703ba114f1/html5/thumbnails/1.jpg)
Documentation for establishing a VLAN inside Virtual Box using OpenVPN Server:
Suggested minimum requirements:
(1) 2GHz or above CPU speed (preferably 2+ cores)
(2) 3GB RAM or more
Images available are:
(1) Ubuntu Desktop with OpenVPN Server preinstalled and preconfigured (this is a simple image for
your own experimentation)
(2) Ubuntu Desktop with JVM and OpenVPN Client preinstalled, and Ubuntu built-in firewall
preconfigured (only allow traffic on port 10000) (use this image for VPN client A)
(3) Ubuntu Desktop with JVM and OpenVPN Client preinstalled and Ubuntu built-in firewall
preconfigured (only allow traffic on port 10000) (use this image for VPN client B)
Overview of the steps required to establish a totally virtualised LAN inside Virtual Box:
(1) Install VirtualBox on your real machine (host)
(2) Mount the OpenVPN Server image into VirtualBox and boot up the Virtual Machine.
(3) For each client Ubuntu image, mount the Ubuntu Desktop image and boot up the Virtual
Machine, log in to the OpenVPN server and download a client configuration, launch OpenVPN
Client using the client configuration file you’ve downloaded.
Detailed Steps:
(1) Installing VirtualBox:
(a) Download VirtualBox 4.0.4 from this URL http://www.blueicon.com/uploads/VirtualBox-
4.0.4-70112-Win.exe
(b) Start the installation by opening your downloaded .exe file, then you will see the screenshot
below.
![Page 2: VLAN Inside Virtual Box Using OpenVPN__BDK_Documentation5](https://reader034.fdocuments.us/reader034/viewer/2022051316/55cf8fe7550346703ba114f1/html5/thumbnails/2.jpg)
(c) Click on Next, then you will see this
(d) Leave everything at its default, and click Next, then you will see this
![Page 3: VLAN Inside Virtual Box Using OpenVPN__BDK_Documentation5](https://reader034.fdocuments.us/reader034/viewer/2022051316/55cf8fe7550346703ba114f1/html5/thumbnails/3.jpg)
(e) The above 2 options is up to you, click Next, then you will see this warning saying that you
will get a disconnection from the Internet and LAN during installation.
![Page 4: VLAN Inside Virtual Box Using OpenVPN__BDK_Documentation5](https://reader034.fdocuments.us/reader034/viewer/2022051316/55cf8fe7550346703ba114f1/html5/thumbnails/4.jpg)
(f) Click on Yes to continue, then you will see this
(g) Click on Install to start the installation, during installation, you will get a series of these
warnings, click on “Continue Anyway” for all of them.
(h) This is the last step of installation, you will see this
![Page 5: VLAN Inside Virtual Box Using OpenVPN__BDK_Documentation5](https://reader034.fdocuments.us/reader034/viewer/2022051316/55cf8fe7550346703ba114f1/html5/thumbnails/5.jpg)
(i) Leave the checkbox ticked, and click on Finish, then VirtualBox will automatically launched.
(2) Mount the OpenVPN server image and boot up the Virtual Machine:
(a) Download the OpenVPN Server image from this URL
http://www.blueicon.com/uploads/OpenVPNServer.vdi , the file name is
OpenVPNServer.vdi
(b) Launch VirtualBox and you will see the main interface of Virtual Box
![Page 6: VLAN Inside Virtual Box Using OpenVPN__BDK_Documentation5](https://reader034.fdocuments.us/reader034/viewer/2022051316/55cf8fe7550346703ba114f1/html5/thumbnails/6.jpg)
(c) Click on “New” in the picture below
(d) Click on Next when you see this
![Page 7: VLAN Inside Virtual Box Using OpenVPN__BDK_Documentation5](https://reader034.fdocuments.us/reader034/viewer/2022051316/55cf8fe7550346703ba114f1/html5/thumbnails/7.jpg)
(e) Give a name/description for your Virtual Machine, e.g. OpenVPNServer, Choose “Linux” for
the Operating System, and choose “Ubuntu” for Version, then Click Next
(f) Leave the memory as default, i.e. 512MB, click next
![Page 8: VLAN Inside Virtual Box Using OpenVPN__BDK_Documentation5](https://reader034.fdocuments.us/reader034/viewer/2022051316/55cf8fe7550346703ba114f1/html5/thumbnails/8.jpg)
(g) Tick the check box “Boot Hard Disk”, choose “Use existing hard disk”, and click on the
browse button to locate your downloaded OpenVPNServer .vdi image file , then click Next
(h) Click Finish
![Page 9: VLAN Inside Virtual Box Using OpenVPN__BDK_Documentation5](https://reader034.fdocuments.us/reader034/viewer/2022051316/55cf8fe7550346703ba114f1/html5/thumbnails/9.jpg)
(i) Highlight the OpenVPNServer Virtual Machine on the left, and click on Settings
(j) Below are the settings required for the OpenVPNServer, these settings are a must,
otherwise you might have to reconfigure the server. Click on the Network tab on the left,
for Adapter 1, check “enable network adapter”, choose “Host-Only Adapter” for Attached
To, choose “VirtualBox Host-Only Ethernet Adapter” for the Name, LEAVE THE ADAPTER
![Page 10: VLAN Inside Virtual Box Using OpenVPN__BDK_Documentation5](https://reader034.fdocuments.us/reader034/viewer/2022051316/55cf8fe7550346703ba114f1/html5/thumbnails/10.jpg)
TYPE AS DEFAULT, VirtualBox will default to the one which suits your hardware. Type in
080027EC4768 for the MAC Address, this setting is most important in order for the server to
run at startup. Check the tickbox for “Cable Connected”
For Adapter 2, check “enable network adapter”, choose “NAT” for Attached To, LEAVE THE
ADAPTER TYPE AS DEFAULT, VirtualBox will default to the one which suits your hardware.
Type in 080027C83172 for the MAC Address, this setting is most important in order for the
server to run at startup. Uncheck the tickbox for “Cable Connected”. Then click on OK.
![Page 11: VLAN Inside Virtual Box Using OpenVPN__BDK_Documentation5](https://reader034.fdocuments.us/reader034/viewer/2022051316/55cf8fe7550346703ba114f1/html5/thumbnails/11.jpg)
(k) Start the Virtual Machine by clicking Start.
(l) After the machine got booted up, we need to check whether the OpenVPN server is running
properly, and also we might need to change one setting in the Admin panel. Click on the
Firefox browser icon on the top bar.
![Page 12: VLAN Inside Virtual Box Using OpenVPN__BDK_Documentation5](https://reader034.fdocuments.us/reader034/viewer/2022051316/55cf8fe7550346703ba114f1/html5/thumbnails/12.jpg)
(m) Click on the “OpenVPNServer Admin” bookmark on the bookmark bar.
![Page 13: VLAN Inside Virtual Box Using OpenVPN__BDK_Documentation5](https://reader034.fdocuments.us/reader034/viewer/2022051316/55cf8fe7550346703ba114f1/html5/thumbnails/13.jpg)
(n) The URL of this bookmark is https://localhost:943/admin/ , if the OpenVPN server is running
correctly, you should see this Administration panel login. If you see something like “cannot
connect”, then one of your previous settings is not correct.
(o) Type in “openvpn” as username, “blueicon” as password. We only need to check if one
setting is correct, which is the local IP address has to be the same as the IP address which
the clients connect to. When you logged in, check that the OpenVPN server has started by
clicking “Status Overview” on the left panel. Now click on “Server Network Settings” on the
left panel, the IP address in the text field must be the same as the one shown below it, if it’s
not, then you need to change it to the IP address under the text field box, and click on “Save
Settings” at the bottom of the page if you need to change it.
![Page 14: VLAN Inside Virtual Box Using OpenVPN__BDK_Documentation5](https://reader034.fdocuments.us/reader034/viewer/2022051316/55cf8fe7550346703ba114f1/html5/thumbnails/14.jpg)
(p) If you have made a change to that IP, you must do the following:
![Page 15: VLAN Inside Virtual Box Using OpenVPN__BDK_Documentation5](https://reader034.fdocuments.us/reader034/viewer/2022051316/55cf8fe7550346703ba114f1/html5/thumbnails/15.jpg)
(q) Once you clicked that, it should say “Running Server Updated”, like in this screenshot
![Page 16: VLAN Inside Virtual Box Using OpenVPN__BDK_Documentation5](https://reader034.fdocuments.us/reader034/viewer/2022051316/55cf8fe7550346703ba114f1/html5/thumbnails/16.jpg)
(r) That’s all for the OpenVPN Server.
(3) Mount an image for one of the nodes and make a connection to the VPN server as a VPN client
(a) Download Ubuntu NodeA.vdi from this URL (
http://www.blueicon.com/uploads/Ubuntu NodeA.vdi )
(b) Click on New to add another image hard disk
![Page 17: VLAN Inside Virtual Box Using OpenVPN__BDK_Documentation5](https://reader034.fdocuments.us/reader034/viewer/2022051316/55cf8fe7550346703ba114f1/html5/thumbnails/17.jpg)
(c) Click Next
(d) Type a name/title for your Virtual Machine, e.g. Ubuntu NodeA , choose Linux for the
Operating System, and Ubuntu as the Version, then click Next
![Page 18: VLAN Inside Virtual Box Using OpenVPN__BDK_Documentation5](https://reader034.fdocuments.us/reader034/viewer/2022051316/55cf8fe7550346703ba114f1/html5/thumbnails/18.jpg)
(e) Leave the memory as default, i.e. 512MB
(f) Check “Boot Hard Disk”, choose “Use existing hard disk”, click the browse button to locate
your downloaded .vdi image file, then click Next
![Page 19: VLAN Inside Virtual Box Using OpenVPN__BDK_Documentation5](https://reader034.fdocuments.us/reader034/viewer/2022051316/55cf8fe7550346703ba114f1/html5/thumbnails/19.jpg)
(g) Click Finish
(h) Highlight the image you just created, click on Settings
![Page 20: VLAN Inside Virtual Box Using OpenVPN__BDK_Documentation5](https://reader034.fdocuments.us/reader034/viewer/2022051316/55cf8fe7550346703ba114f1/html5/thumbnails/20.jpg)
(i) Click on “Network” on the left panel, we only need one Adapter here. Check “Enable
Network Adapter”, choose “Host-only Adapter” for Attached to, choose “VirtualBox Host-
Only Ethernet Adapter” for Name, leave the Adapter Type as default, no need change the
MAC address randomly generated by VirtualBox, make sure the “Cable Connected” is
checked. Click OK
![Page 21: VLAN Inside Virtual Box Using OpenVPN__BDK_Documentation5](https://reader034.fdocuments.us/reader034/viewer/2022051316/55cf8fe7550346703ba114f1/html5/thumbnails/21.jpg)
(j) Click start to start this virtual machine
![Page 22: VLAN Inside Virtual Box Using OpenVPN__BDK_Documentation5](https://reader034.fdocuments.us/reader034/viewer/2022051316/55cf8fe7550346703ba114f1/html5/thumbnails/22.jpg)
(k) We are now up to the step to connect this virtual machine as a VPN client to the OpenVPN
Server. Click on the Firefox icon on the top to open the Firefox browser.
(l) On the URL, type in https://IPAddressOfOpenVPNServer:10000 , this is the IP Address you
saw when you logged into the OpenVPN Server Administration page. When you go into this
page, you will see a warning.
![Page 23: VLAN Inside Virtual Box Using OpenVPN__BDK_Documentation5](https://reader034.fdocuments.us/reader034/viewer/2022051316/55cf8fe7550346703ba114f1/html5/thumbnails/23.jpg)
(m) Scroll down to the bottom, and click on “Add Exception”
![Page 24: VLAN Inside Virtual Box Using OpenVPN__BDK_Documentation5](https://reader034.fdocuments.us/reader034/viewer/2022051316/55cf8fe7550346703ba114f1/html5/thumbnails/24.jpg)
(n) Uncheck “Permanently store this exception”, then click on “Confirm Security Exception”
(o) I have created 10 users in the OpenVPN server, usernames are node1, node2 ….. etc, and
the password are all the same, which is “blueicon”. Type in “node1” as the username, and
“blueicon” as the password. Choose “Login”, and click Go.
![Page 25: VLAN Inside Virtual Box Using OpenVPN__BDK_Documentation5](https://reader034.fdocuments.us/reader034/viewer/2022051316/55cf8fe7550346703ba114f1/html5/thumbnails/25.jpg)
(p) You will see a page like this
![Page 26: VLAN Inside Virtual Box Using OpenVPN__BDK_Documentation5](https://reader034.fdocuments.us/reader034/viewer/2022051316/55cf8fe7550346703ba114f1/html5/thumbnails/26.jpg)
(q) Scroll down to the bottom, and download the VPN client configuration file by left clicking
“Yourself (user-locked profile)”
(r) When the download pop-up box comes up, Choose “Save File”, then click “OK”
![Page 27: VLAN Inside Virtual Box Using OpenVPN__BDK_Documentation5](https://reader034.fdocuments.us/reader034/viewer/2022051316/55cf8fe7550346703ba114f1/html5/thumbnails/27.jpg)
(s) We are now ready to connect to the OpenVPN server by using the downloaded
configuration file. Open a terminal window by clicking Accessories, then Terminal.
![Page 28: VLAN Inside Virtual Box Using OpenVPN__BDK_Documentation5](https://reader034.fdocuments.us/reader034/viewer/2022051316/55cf8fe7550346703ba114f1/html5/thumbnails/28.jpg)
(t) Connect to the OpenVPN server by typing this command: sudo openvpn -config
/home/blueicon/Downloads/client.ovpn
(u) The you will be prompted to type the Administrator password, the password is “blueicon”.
![Page 29: VLAN Inside Virtual Box Using OpenVPN__BDK_Documentation5](https://reader034.fdocuments.us/reader034/viewer/2022051316/55cf8fe7550346703ba114f1/html5/thumbnails/29.jpg)
(v) Then you will be prompted for a username and password for logging into the OpenVPN
server, type “node1” as username, and “blueicon” as password.
![Page 30: VLAN Inside Virtual Box Using OpenVPN__BDK_Documentation5](https://reader034.fdocuments.us/reader034/viewer/2022051316/55cf8fe7550346703ba114f1/html5/thumbnails/30.jpg)
(w) If you see this message “Initialization Sequence Completed”, that means you have
successfully connected to the OpenVPN Server as a VPN client.
(x) Repeat all these steps for adding another VPN client to your VLAN, except for the step when
you go to download the client configuration file, log in as “node2”, same password. The URL
to download VPN Client B is here (http://www.blueicon.com/uploads/Ubuntu NodeB.vdi).
![Page 31: VLAN Inside Virtual Box Using OpenVPN__BDK_Documentation5](https://reader034.fdocuments.us/reader034/viewer/2022051316/55cf8fe7550346703ba114f1/html5/thumbnails/31.jpg)
Appendix
![Page 32: VLAN Inside Virtual Box Using OpenVPN__BDK_Documentation5](https://reader034.fdocuments.us/reader034/viewer/2022051316/55cf8fe7550346703ba114f1/html5/thumbnails/32.jpg)
![Page 33: VLAN Inside Virtual Box Using OpenVPN__BDK_Documentation5](https://reader034.fdocuments.us/reader034/viewer/2022051316/55cf8fe7550346703ba114f1/html5/thumbnails/33.jpg)
Change Rules in firewall
Even though the firewall in the VPN client node images
are preconfigured to allow only traffic for port 10000, the
below screenshot shows how to change the rules in the
firewall.
(a) Click on System, Administration, Firewall Configuration
(b) You will then prompted to type in the Administrator password, which is
“blueicon”
(c) This is the GUI for the firewall configuration, which can be downloaded
from issuing this command in the terminal: sudo apt-get install gufw
![Page 34: VLAN Inside Virtual Box Using OpenVPN__BDK_Documentation5](https://reader034.fdocuments.us/reader034/viewer/2022051316/55cf8fe7550346703ba114f1/html5/thumbnails/34.jpg)