From 8081a5520a441b43a8a7a73f3a90c7aacfaa8e10 Mon Sep 17 00:00:00 2001
From: Timotej Lazar
Date: Sun, 24 Feb 2019 21:05:27 +0100
Subject: Move everything one level up
---
.../tasks/set_ip_static_dhcp/howtos/en/index.html | 73 ------------
.../tasks/set_ip_static_dhcp/howtos/images/04.png | Bin 11706 -> 0 bytes
.../tasks/set_ip_static_dhcp/howtos/images/09.png | Bin 187608 -> 0 bytes
.../tasks/set_ip_static_dhcp/howtos/images/10.png | Bin 193147 -> 0 bytes
.../tasks/set_ip_static_dhcp/howtos/images/11.png | Bin 189272 -> 0 bytes
.../tasks/set_ip_static_dhcp/howtos/images/12.png | Bin 163954 -> 0 bytes
.../tasks/set_ip_static_dhcp/howtos/images/13.png | Bin 175600 -> 0 bytes
.../tasks/set_ip_static_dhcp/howtos/images/17.png | Bin 7062 -> 0 bytes
.../tasks/set_ip_static_dhcp/howtos/si/index.html | 74 ------------
kpov_judge/tasks/set_ip_static_dhcp/task.py | 127 ---------------------
10 files changed, 274 deletions(-)
delete mode 100644 kpov_judge/tasks/set_ip_static_dhcp/howtos/en/index.html
delete mode 100644 kpov_judge/tasks/set_ip_static_dhcp/howtos/images/04.png
delete mode 100644 kpov_judge/tasks/set_ip_static_dhcp/howtos/images/09.png
delete mode 100644 kpov_judge/tasks/set_ip_static_dhcp/howtos/images/10.png
delete mode 100644 kpov_judge/tasks/set_ip_static_dhcp/howtos/images/11.png
delete mode 100644 kpov_judge/tasks/set_ip_static_dhcp/howtos/images/12.png
delete mode 100644 kpov_judge/tasks/set_ip_static_dhcp/howtos/images/13.png
delete mode 100644 kpov_judge/tasks/set_ip_static_dhcp/howtos/images/17.png
delete mode 100644 kpov_judge/tasks/set_ip_static_dhcp/howtos/si/index.html
delete mode 100644 kpov_judge/tasks/set_ip_static_dhcp/task.py
(limited to 'kpov_judge/tasks/set_ip_static_dhcp')
diff --git a/kpov_judge/tasks/set_ip_static_dhcp/howtos/en/index.html b/kpov_judge/tasks/set_ip_static_dhcp/howtos/en/index.html
deleted file mode 100644
index 74dfeea..0000000
--- a/kpov_judge/tasks/set_ip_static_dhcp/howtos/en/index.html
+++ /dev/null
@@ -1,73 +0,0 @@
-
-
Purpose of the assignment
-Learn how to setup network interfaces in most modern Linux distributions (NetworkManager).
-
-
-
Quick instructions
-Set a static IP in NetworkManager, set a static IP and DNS server in /etc/network/interfaces. You'll get both IP's when you execute script run_test.py.
-
-
-
Instructions
-
-- From the directory with images of virtual computers, download the following:
maliNetworkManager, maliBrezNetworkManager, SimpleArbiterDhcp.
-
-- Set the network for virtual computers, so that SimpleArbiterDhcp's 1. nework interface is connected to the same network, as the only network interface for maliNetworkManager and maliBrezNetworkManager,
- SimpleArbiterDhcp's 2. network interface will be connected to a NAT or a physical network, where the address and route (gateway) to the internet is obtained via DHCP.
-
-- Start SimpleArbiterDhcp. Sign in as user "tester" with password "SedemKrogovPekla".
--
-
-Use command ping 193.2.1.66
to check if SimpleArbiterDhcp is connected to internet. If you get ping reply, you're connected to the internet. Cancel the ping with combination CTRL+C.
- If SimpleArbiterDhcp doesn't have internet access, change the network settings in Virtual box for 1. and 2. network interface, then restart the virtual computer.
-
-
-- Run the script run_test.py.
-
-- Enter "03.predvaja" as assignment name.
-
-- Read the maliNetworkManager's static IP . Leave SimpleArbiterDhcp running in the background until you have setup the maliNetworkManager.
-
-- Start maliNetworkManager.
-
--
-Sign in the GUI(graphical user interface) using username "student" and password "vaje".
-
-Right click on the icon for network settings.
-
--
-
-Choose "Edit Connections"
-
--
-
-Click "Edit"
-
--
-
-In tab "IPv4" change the "Method" to "Manual". Click "Add". Set the SimpleArbiterDhcp's static IP as static IP A.
-Add Arnes DNS: 193.2.1.66 to DNS servers.
-
-- Click "Save"
-
-- Switch to SimpleArbiterDhcp. Click "Enter" or "OK".
-
-- Read maliBrezNetworkManager's IP . Click "OK". Read the DNS server's address .
-
-- Switch to maliBrezNetworkManager. Switch to first console using combination CTRL+ALT+F1. Sign in as root (su) with password "kaboom".
-
-- Open the file /etc/network/interfaces. Edit the settings according to the information you got on SimpleArbiter. Entry for network interface should look something like this:
-
-allow-hotplug eth0
-iface eth0 inet static
- 10.0.1.2
- netmask 255.255.255.128
- dns-nameservers 10.0.1.5
-
-
-
-- Save the settings. Use the command
reboot
to restart maliBrezNetworkManager. On boot the NetworkManager reads which network interfaces are configured in /etc/network/interfaces. After that NetworkManager doesn't manage these interfaces anymore.
-
-
-Press OK on SimpleArbiterDhcp. If all went ok, you have completed this assignment.
-
-
diff --git a/kpov_judge/tasks/set_ip_static_dhcp/howtos/images/04.png b/kpov_judge/tasks/set_ip_static_dhcp/howtos/images/04.png
deleted file mode 100644
index 754c200..0000000
Binary files a/kpov_judge/tasks/set_ip_static_dhcp/howtos/images/04.png and /dev/null differ
diff --git a/kpov_judge/tasks/set_ip_static_dhcp/howtos/images/09.png b/kpov_judge/tasks/set_ip_static_dhcp/howtos/images/09.png
deleted file mode 100644
index 866a51d..0000000
Binary files a/kpov_judge/tasks/set_ip_static_dhcp/howtos/images/09.png and /dev/null differ
diff --git a/kpov_judge/tasks/set_ip_static_dhcp/howtos/images/10.png b/kpov_judge/tasks/set_ip_static_dhcp/howtos/images/10.png
deleted file mode 100644
index d6ccf42..0000000
Binary files a/kpov_judge/tasks/set_ip_static_dhcp/howtos/images/10.png and /dev/null differ
diff --git a/kpov_judge/tasks/set_ip_static_dhcp/howtos/images/11.png b/kpov_judge/tasks/set_ip_static_dhcp/howtos/images/11.png
deleted file mode 100644
index 10b5ec7..0000000
Binary files a/kpov_judge/tasks/set_ip_static_dhcp/howtos/images/11.png and /dev/null differ
diff --git a/kpov_judge/tasks/set_ip_static_dhcp/howtos/images/12.png b/kpov_judge/tasks/set_ip_static_dhcp/howtos/images/12.png
deleted file mode 100644
index 0a87ae6..0000000
Binary files a/kpov_judge/tasks/set_ip_static_dhcp/howtos/images/12.png and /dev/null differ
diff --git a/kpov_judge/tasks/set_ip_static_dhcp/howtos/images/13.png b/kpov_judge/tasks/set_ip_static_dhcp/howtos/images/13.png
deleted file mode 100644
index e71474a..0000000
Binary files a/kpov_judge/tasks/set_ip_static_dhcp/howtos/images/13.png and /dev/null differ
diff --git a/kpov_judge/tasks/set_ip_static_dhcp/howtos/images/17.png b/kpov_judge/tasks/set_ip_static_dhcp/howtos/images/17.png
deleted file mode 100644
index d4bba87..0000000
Binary files a/kpov_judge/tasks/set_ip_static_dhcp/howtos/images/17.png and /dev/null differ
diff --git a/kpov_judge/tasks/set_ip_static_dhcp/howtos/si/index.html b/kpov_judge/tasks/set_ip_static_dhcp/howtos/si/index.html
deleted file mode 100644
index 6236245..0000000
--- a/kpov_judge/tasks/set_ip_static_dhcp/howtos/si/index.html
+++ /dev/null
@@ -1,74 +0,0 @@
-
-
Namen vaje
-Naučite se, kako se nastavljajo omrežni vmesniki v večini sodobnih Linux distribucij (NetworkManager).
-
-
-
Naloga na hitro
-Nastavi statičen IP v NetworkManager-ju, nastavi statični IP in DNS strežnik v /etc/network/interfaces. Oba naslova računalnikov in DNS strežnikov dobite ob zagonu run_test.py.
-
-
-
Navodila
-
-- Z imenika s slikami virtualnih računalnikov povlecite slike maliNetworkManager, maliBrezNetworkManager, SimpleArbiterGW
-
-- Nastavite omrežja navideznih računalnikov tako, da bo
1. omrežni vmesnik SimpleArbiterGW povezan na isto omrežje kot edini omrežni vmesnik maliNetworkManager in maliBrezNetworkManager,
- 2. vmesnik SimpleArbiterGW bo povezan na NAT ali fizično omrežje, kjer prek DHCP dobi naslov in pot (prehod, gateway) do Interneta.
-
-- Zaženite SimpleArbiterGW. Prijavite se kot uporabnik tester z geslom SedemKrogovPekla
--
-
-Z ukazom ping 8.8.8.8
preverite, ali je SimpleArbiterGW na Internetu. Če je, boste približno vsako sekundo dobili odziv. Ping prekinete
-s kombinacijo tipk CTRL+C.
- Če SimpleArbiterGW ne pride do Interneta, v VirtualBox zamenjajte nastavitve 1. in 2. omrežni vmesnik ter ponovno zaženite navidezni računalnik.
-
-- Poženite run_test.py.
-
-- Kot ime naloge vpišite preparation
-
-- Preberite statični IP maliNetworkManager. Pustite SimpleArbiterGW da teče v ozadju, dokler niste nastavili maliNetworkManager
-
-- Zaženite maliNetworkManager.
-
--
-Prijavite se v grafično okolje z uporabniškim imenom student, geslom vaje
-
-Desno-kliknite na ikono za mrežne nastavitve.
-
--
-
-Izberite "Edit Connections".
-
--
-
-Kliknite "Edit"
-
--
-
-V zavihku "IPv4" spremenite "Method" na "Manual". Kliknite na "Add". Nastavite statični IP, ki ste ga prebrali na SimpleArbiterGW kot statični I.
-V DNS servers dodajte naslov DNSja, ki van ha poda run_test.py. Kot gateway dodaj IP SimpleArbiterGW.
-
-- Kliknite "Save".
-
-- Preklopite na SimpleArbiterGW. Pritisnite "Enter" oz. "OK".
-
-- Preberite IP maliBrezNetworkManager. Pritisnite "OK". Preberite naslov DNS strežnika.
-
-- Preklopite na maliBrezNetworkManager. Preklopite na prvo konzolo s kombinacijo CTRL+ALT+F1. Prijavite se kot root z geslom kaboom.
-
-- Odprite datoteko /etc/network/interfaces. Popravite nastavitve v skladu s podatki, ki ste jih dobili na SimpleArbiter. Vnos za omrežni vmesnik mora izgledati približno takole:
-
-allow-hotplug eth0
-iface eth0 inet static
- address "Podan IP"
- netmask 255.255.255.0
- dns-nameservers "Podan DNS"
- getway "IP SimpleArbiterGW"
-
-
-
-- Shranite nastavitve. Z ukazoma "ifdown eth0", in ifup eth0" posodobite NetworkManager ki prebere
-kateri omrežni vmesniki so nastavljeni v /etc/network/interfaces. Za te vmesnike potem ne skrbi več.
-
-Na SimpleArbiterGW pritisnite OK. Če je šlo vse po sreči, ste opravili tokratno nalogo.
-
-
diff --git a/kpov_judge/tasks/set_ip_static_dhcp/task.py b/kpov_judge/tasks/set_ip_static_dhcp/task.py
deleted file mode 100644
index 0d11f43..0000000
--- a/kpov_judge/tasks/set_ip_static_dhcp/task.py
+++ /dev/null
@@ -1,127 +0,0 @@
-# kpov_util should be imported by add_assignment.py
-
-instructions = {
- 'si': '''\
-
-Ustvari tri navidezne računalnike. Za prvega uporabi sliko diska simpleArbiterDhcpGW, za drugega sliko diska
-maliNetworkManager, za tretjega sliko diska maliBrezNetworkManager. Računalnike imenujmo enako kot slike diska.
-
-
-Na maliBrezNetworkManager poskrbi, da NetworkManager ne bo več skrbel za omrežni vmesnik, temveč bosta delovala ukaza ifup
in ifdown
.
-
-
-Na maliNetworkManager nastavi naslov IP {{IP_NM}}
ter DNS {{DNS_NM}}
.
-
-
-Na maliBrezNetworkManager nastavi naslov IP {{IP_static}}
ter DNS {{DNS_static}}
.
-''',
- 'en': '''\
-
-Create three virtual machines. Use simpleArbiterDhcpGW as the disk image for the first, maliNetworkManager as the disk image for the second, and maliBrezNetworkManager for the third. The virtual machine names can match the disks.
-
-
-Make sure that on maliBrezNetworkManager ifup
and ifdown
can be used to configure the network and that NetworkManager, while still installed, will not manage the network interface. The IP should be {{IP_static}}
and the computer should use the server {{DNS_static}}
for DNS.
-
-
-On maliNetworkManager, set the IP address to {{IP_NM}}
and use {{DNS_NM}}
for DNS.
-''',
-}
-
-computers = {
- 'maliNetworkManager': {
- 'disks': [
- { 'name': 'maliNetworkManager',
- },
- ],
- 'network_interfaces': [{'network': 'net1'}],
- 'flavor': 'm1.tiny',
- 'config_drive': False
-
- },
- 'maliBrezNetworkManager': {
- 'disks': [
- { 'name': 'maliBrezNetworkManager',
- },
- ],
- 'network_interfaces': [{'network': 'net1'}],
- 'flavor': 'm1.tiny',
- 'config_drive': False
-
- },
- 'SimpleArbiter': {
- 'disks': [
- { 'name': 'simpleArbiterDhcpGW',
- },
- ],
- 'network_interfaces': [{'network': 'net1'}, {'network': 'test-net'}],
- 'flavor': 'm1.tiny',
- 'config_drive': False
- }
-}
-
-networks = { 'net1': {'public': False}, 'test-net': {'public': True} }
-
-params_meta = {
- 'IP_NM': {'descriptions': {'si': 'Naslov maliNetworkManager', 'en': 'IP address for maliNetworkManager'}, 'w': False, 'public':True, 'type': 'IP', 'generated': True},
- 'DNS_NM': {'descriptions': {'si': 'DNS za maliNetworkManager', 'en': 'DNS for maliNetworkManager'}, 'w': False, 'public':True, 'type': 'IP', 'generated': True},
- 'IP_static': {'descriptions': {'si': 'Naslov maliBrezNetworkManager', 'en': 'IP address for maliBrezNetworkManager'}, 'w': False, 'public': True, 'type': 'IP', 'generated': True},
- 'DNS_static': {'descriptions': {'si': 'DNS za maliBrezNetworkManager', 'en':'DNS for maliBrezNetworkManager'}, 'w': False, 'public': True, 'type': 'IP', 'generated': True},
-}
-
-def task(IP_NM, DNS_NM, IP_static, DNS_static):
- import collections
-
- tests = (
- ('nmcli', 'nmcli -c no d'),
- ('nslookup', 'nslookup www.arnes.si'),
- )
-
- results = collections.defaultdict(str)
- for name, host in [('nm', IP_NM), ('static', IP_static)]:
- host_results = kpov_util.ssh_test(host, 'student', 'vaje', tests)
- for key, value in host_results.items():
- results[key+'-'+name] = value
- return results
-
-def gen_params(user_id, params_meta):
- params = dict()
- r = random.Random(user_id)
- dns_servers = ['193.2.1.66', '193.2.1.72', '8.8.8.8', '8.8.4.4', '208.67.222.222', '208.67.220.220']
- net = kpov_util.IPv4_subnet_gen(r, '10.94.96.0/19', 25)
- params['DNS_NM'] = r.choice(dns_servers)
- params['IP_NM'], params['IP_static'] = kpov_util.IPv4_addr_gen(r, net, 2)
- params['DNS_static'] = r.choice(dns_servers)
- return params
-
-def task_check(results, params):
- import re
- score = 0
- hints = []
- if results['ssh-nm'] is True:
- score += 1
- else:
- hints += ['mali ssh failed: ' + results['ssh-nm']]
- if results['ssh-static'] is True:
- score += 1
- else:
- hints += ['malibrez ssh failed: ' + results['ssh-static']]
- if params['DNS_NM'] in results['nslookup-nm']:
- score += 2
- else:
- hints += ['NM nslookup incorrect']
- if params['DNS_static'] in results['nslookup-static']:
- score += 2
- else:
- hints += ['static nslookup incorrect']
- if re.search(r'e(th0|np0s3|ns3) +ethernet +connected', results['nmcli-nm']):
- score += 2
- else:
- hints += ['nmcli incorrect']
- if re.search(r'e(th0|np0s3|ns3) +ethernet +unmanaged', results['nmcli-static']):
- score += 2
- else:
- hints += ['nmcli on malibrez incorrect']
- return score, hints
-
-def prepare_disks(templates, task_params, global_params):
- write_default_config(templates['simpleArbiterDhcpGW'], global_params)
--
cgit v1.2.1