diff options
Diffstat (limited to 'kpov_judge/tasks')
-rw-r--r-- | kpov_judge/tasks/openvpn_simple_smb/howtos/en/index.html | 61 | ||||
-rw-r--r-- | kpov_judge/tasks/openvpn_simple_smb/task.py | 11 |
2 files changed, 72 insertions, 0 deletions
diff --git a/kpov_judge/tasks/openvpn_simple_smb/howtos/en/index.html b/kpov_judge/tasks/openvpn_simple_smb/howtos/en/index.html new file mode 100644 index 0000000..9bd7bc5 --- /dev/null +++ b/kpov_judge/tasks/openvpn_simple_smb/howtos/en/index.html @@ -0,0 +1,61 @@ +<html>
+
+<head>
+<meta http-equiv=Content-Type content="text/html; charset=utf-8">
+</head>
+
+<body><font face="Georgia, Times New Roman, Times, serif">
+<strong><h1>OpenVPN and SMB task:</h1></strong>
+<p><strong><h2>Quick task:</h2></strong><br>
+ Connect to VPN with OpenVPN. Enable access to files through NFS and copy them through SMB.</p>
+<p><strong><h2>Navodila:</h2></strong><br>
+ 1. From Directory with images of virtual computers drag twice the picture SimpleArbiterVPN and VPNClient.<br>
+ 2. With VirtualBoxom (or other programs for virtual computers) create two virtual computers and give them VPNCLient.vdi and SimpleArbiterVPN.vdi as disk for storage.<br>
+ 3. On both set two network interface(NAT and Internal) and run them.<br>
+ 4. On both VM login with username <strong>root</strong> and password <strong>kaboom</strong> .</p>
+<p><h3><u><strong><em>First part: Set up OpenVPN on SimpleArbiterVPN and VPNClient.</em></strong></u></h3>
+<p><h4><u><strong><em>Settings on the server:</em></strong></u></h4>
+ 1. Download packages <strong>uml-utilities</strong> -> to adjust the virtual network interfaces and packet (<strong>openvpn</strong>). example: sudo apt-get install openvpn<br>
+ 2. The new virtual network interface create with <strong>tunctl</strong> and specify IP with <strong>sudo ifconfig tap0 10.P.Q.R netmask 255.255.255.0</strong><br>
+ 3. Then generirate common key (you will share that key with client) with the command: <strong>openvpn --genkey --secret vpnkljuc.key</strong><br>
+ 4. On server set the configuration file tap0.conf, which should contain (split by lines) "dev tap0","proto tcp-server", "secret vpnkljuc.key"<br>
+ 5. Run openvpn with <strong>openvpn --config /some_directory/somewhere/tap0.conf</strong><br/>
+<p><h4><u><strong><em>Settings on the client:</em></strong></u></h4>
+1., 2. steps are the same as the settings on the server<br>
+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"<br>
+4. On OpenVPN server connect to <strong>openvpn --config /some_directory/somewhere/tap0.conf</strong><br/>
+<p>
+ <u><strong><em><h3>Second part: write a program, which converts the binary record 32-bit number in decimal.</h3></em></strong></u><br>
+ The task can be made in Java or Python. You can also write code in any text editor.</p>
+<p><br>
+ JAVA------<br>
+ 1. With command nano bintodec3.java create and open empty program with text editor nano<br>
+ 2. Write a program for converting 24-bit number in two's complement into a decimal shape<br>
+<img src="slike/bu6.png"><br><img src="slike/bu7.png"><br>
+ 3. Click Ctrl+X, then Y and Enter, that the program is closed and stored.<br>
+ 4. If you don't have it, install Java <strong>sudo apt-get install openjdk-6-jdk</strong><br><img src="slike/predvaja_clip_image003.gif"><br>
+ 5. Compile program <strong>javac bintodec3.java</strong><br>
+ 6. You can run and test the program <strong>java bintodec3</strong>. On the standard input are entered 24-bit numbers in hexadecimal format<br><img src="slike/bu9.png"><br></p>
+<p>PYTHON------<br>
+ 1. With command nano bintodec3.py create and open empty program with text editor nano<br>
+ 2. Write a program which converts 24-bit number in two's complement into a decimal shape<br>
+<img src="slike/bu5.png"><br>
+ 3. Click Ctrl+X, then Y and Enter, that the program is closed and stored.<br>
+ 4. Start the program with command <strong>python bintodec3.py</strong><br><img src="slike/bu8.png"><br></p><br><br>
+
+
+ <p>
+ <h3> Testing </h3>
+ 1. You can start the test program with command ./run_test.py<br>
+ <img src="slike/s1.png"><br>
+ 2. For "Upor. Ime" and "Geslo" write your username and password. (example.: "pz1234@student.uni-lj.si" and "geslo123")<br>
+ <img src="slike/s2.png"> <img src="slike/s3.png"> <br>
+ 3. For the name of the task write XX.predvaja.<br>
+ 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)<br>
+ 5. When he asks you about IP address SimpleArbiterja, enter.<br>
+ 6. If the program returns OK your task is finished.</p>
+
+ </font>
+</body>
+
+</html>
\ No newline at end of file diff --git a/kpov_judge/tasks/openvpn_simple_smb/task.py b/kpov_judge/tasks/openvpn_simple_smb/task.py index 0b497ca..231529b 100644 --- a/kpov_judge/tasks/openvpn_simple_smb/task.py +++ b/kpov_judge/tasks/openvpn_simple_smb/task.py @@ -13,6 +13,17 @@ datoteko za OpenVPN povezavo. Nato poskrbite, da bo VPNClient na navideznem omre dostop do imenika /home/test/IME_IMENIKA, pri čemer IME_IMENIKA preberite na SimpleArbiter. V ta imenik skopirajte datoteke, ki so prek SMB dostopne na SimpleArbiter. """ + + 'en':u""" +Setup three virtual machines - SimpleArbiterVPN and two VPN clients (VPNClient1, VPNClient2). Set both +clients network cards so that they will have access to internal network and internet. Install OpenVPN to +all three machines and a program for supervising virtual devices (which you will use to create device tap). +Server SimpleArbiterVPN should generate a common secret (*.key), which you should save to /vpn directory +and use on VPNClient together with configuration file for OpenVPN connection. After that make sure that +VPNClient has enabled access to /home/test/IME_IMENIKA over NFS on it's virtual connection. You will get +IME_IMENIKA from SimpleArbiter. Copy files that should be available from AimpleArbiter over SMB to IME_IMENIKA. + +""" } computers = { |