OpenVPN and SMB task:

Quick task:


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

Instructions:


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: Access to imenika /home/test/IME_IMENIKA over NFS

Client settings:

1. Using "sudo apt-get install nfs-kernel-server" we install nfs service
2. Create a directory /home/test/IME_IMENIKA
3. To /etc/exports add line /home/test/bla IP_client 4. Use sudo exportfs -a to save 5. Restart service using "sudo service nfs-kernel-server start"

Client settings:

1. Instal client for nfs with command "sudo apt-get install nfs-common"
2. Create mounting directory "sudo mkdir -p /mnt/nfs/home/test" and mount servers file "sudo mount IP_SERVER:/home/test"
3. For automatic mounting we add previous commands to /etc/fstab

How-to za uporabo kpov-judge za OpenVPN


howto: task_check(results, params): Metoda dobi, kot prvi argument rezultat metode task(...), kot drugi pa rezultat funkcije gen_params(). Vrne stevilo pridobljenih tock. howto: task(...): Metoda prejme naslednje argumente: - IP naslov VPN streznika - DNS naslov VPN streznika - IP naslov klienta 1 - DNS naslov klienta 1 - IP naslov klienta 2 - DNS naslov klienta 2 Vrne slovar rezultatov: results['SimpleArbiter_is_VPN_set_up'] pove ali je VPN streznik nastavljen results['SimpleArbiter_is_VPN_running'] pove ali je VPN streznik zagnan results['SimpleArbiter_ping_C1'] ping rezultati (streznik -> klient1) results['SimpleArbiter_ping_C2'] ping rezultati (streznik -> klient2) results['SimpleArbiter_nmap_results'] pove ali sta oba klienta povezana na pravi VPN streznik results['SimpleArbiter_dir_vpn_contents'] kljuc, ce se ta nahaja v ustreznem imeniku results['SimpleArbiter_nfs_access_control_list'] preveri ce NFS dovoljuje dostop do /home/test/IME_UPORABNIKA results['VPNClient1_ping_VPN_server'] ping rezultati (klient 1 -> strežnik) results['VPNClient2_ping_VPN_server'] ping rezultati (klient 2 -> strežnik)