OpenVPN and SMB task:

Quick task:


Connect to VPN with OpenVPN. Enable access to files through NFS and copy them through SMB.

Navodila:


1. From Directory with images of virtual computers drag twice the picture SimpleArbiterVPN and VPNClient.
2. With VirtualBox (or other programs for virtual computers) create two virtual computers and give them VPNCLient.vdi and SimpleArbiterVPN.vdi as disk for storage.
3. On both set two network interface(NAT and Internal) and run them.
4. On both VM login with username root and password kaboom .

First part: Set up OpenVPN on SimpleArbiterVPN and VPNClient.

Settings on the server:

1. Download packages uml-utilities -> to adjust the virtual network interfaces and packet (openvpn). example: sudo apt-get install openvpn
2. The new virtual network interface create with tunctl and specify IP with sudo ifconfig tap0 10.P.Q.R netmask 255.255.255.0
3. Then generirate common key (you will share that key with client) with the command: openvpn --genkey --secret vpnkljuc.key
4. On server set the configuration file tap0.conf, which should contain (split by lines) "dev tap0","proto tcp-server", "secret vpnkljuc.key"
5. Run openvpn with openvpn --config /some_directory/somewhere/tap0.conf

Settings on the client:

1., 2. steps are the same as the settings on the server
3. Create configuration file tap0.conf, which should contain (split by lines) "remote IP_OF_YOUR_VPN_SERVR", "dev tap0", "proto tcp-client", "secret vpnkljuc.key"
4. On OpenVPN server connect to openvpn --config /some_directory/somewhere/tap0.conf

Second part: write a program, which converts the binary record 32-bit number in decimal.


The task can be made in Java or Python. You can also write code in any text editor.


JAVA------
1. With command nano bintodec3.java create and open empty program with text editor nano
2. Write a program for converting 24-bit number in two's complement into a decimal shape


3. Click Ctrl+X, then Y and Enter, that the program is closed and stored.
4. If you don't have it, install Java sudo apt-get install openjdk-6-jdk

5. Compile program javac bintodec3.java
6. You can run and test the program java bintodec3. On the standard input are entered 24-bit numbers in šhexadecimal format

PYTHON------
1. With command nano bintodec3.py create and open empty program with text editor nano
2. Write a program, which converts 24-bit number in two's complement into a decimal shape

3. Click Ctrl+X, then Y and Enter, that the program is closed and stored.
4. Start the program with command python bintodec3.py



Testing

1. You can start the test program with command ./run_test.py

2. For "Upor. Ime" and "Geslo" write your username and password. (example.: "pz1234@student.uni-lj.si" and "geslo123")

3. For the name of the task write XX.predvaja.
4. When a program asks you for path, enter your path to program for converting. (example.: if you have a program bintodec3.py in the same map as program run_test.py, enter: ./bintodec3.py)
5. When he asks you about IP address SimpleArbiterja, enter.
6. If the program returns OK your task is finished.