This repository contains the Vagrant files required to run the virtual lab environment used in the DNCS course.
+-----------------------------------------------------+
| |
| |eth0
+--+--+ +------------+ +------------+
| | | | | |
| | eth0| |eth2 eth2| |
| +----------------+ router-1 +-------------+ router-2 |
| | | | | |
| | | | | |
| M | +------------+ +------------+
| A | |eth1 |eth1
| N | | |
| A | | |
| G | | +-----+----+
| E | |eth1 | |
| M | +-------------------+ | |
| E | eth0| | | host-c |
| N +------------+ SWITCH | | |
| T | | | | |
| | +-------------------+ +----------+
| V | |eth2 |eth3 |eth0
| A | | | |
| G | | | |
| R | |eth1 |eth1 |
| A | +----------+ +----------+ |
| N | | | | | |
| T | eth0| | | | |
| +--------+ host-a | | host-b | |
| | | | | | |
| | | | | | |
++-+--+ +----------+ +----------+ |
| | |eth0 |
| | | |
| +------------------------------+ |
| |
| |
+--------------------------------------------------------+
- Python 3
- 10GB disk storage
- 2GB free RAM
- Virtualbox
- Vagrant (https://www.vagrantup.com)
- Internet
- Install Virtualbox and Vagrant
- Clone this repository
git clone https://github.com/fabrizio-granelli/dncs-lab
- You should be able to launch the lab from within the cloned repo folder.
cd dncs-lab
[~/dncs-lab] vagrant up
Once you launch the vagrant script, it may take a while for the entire topology to become available.
- Verify the status of the 4 VMs
[dncs-lab]$ vagrant status
Current machine states:
router running (virtualbox)
switch running (virtualbox)
host-a running (virtualbox)
host-b running (virtualbox)
- Once all the VMs are running verify you can log into all of them:
vagrant ssh router
vagrant ssh switch
vagrant ssh host-a
vagrant ssh host-b
vagrant ssh host-c
This section describes the assignment, its requirements and the tasks the student has to complete. The assignment consists in a simple piece of design work that students have to carry out to satisfy the requirements described below. The assignment deliverable consists of a Github repository containing:
- the code necessary for the infrastructure to be replicated and instantiated
- an updated README.md file where design decisions and experimental results are illustrated
- an updated answers.yml file containing the details of your project
- Hosts 1-a and 1-b are in two subnets (Hosts-A and Hosts-B) that must be able to scale up to respectively 119 and 513 usable addresses
- Host 2-c is in a subnet (Hub) that needs to accommodate up to 271 usable addresses
- Host 2-c must run a docker image (dustnic82/nginx-test) which implements a web-server that must be reachable from Host-1-a and Host-1-b
- No dynamic routing can be used
- Routes must be as generic as possible
- The lab setup must be portable and executed just by launching the
vagrant up
command
- Fork the Github repository: https://github.com/fabrizio-granelli/dncs-lab
- Clone the repository
- Run the initiator script (dncs-init). The script generates a custom
answers.yml
file and updates the Readme.md file with specific details automatically generated by the script itself. This can be done just once in case the work is being carried out by a group of (<=2) engineers, using the name of the 'squad lead'. - Implement the design by integrating the necessary commands into the VM startup scripts (create more if necessary)
- Modify the Vagrantfile (if necessary)
- Document the design by expanding this readme file
- Fill the
answers.yml
file where required (make sure that is committed and pushed to your repository) - Commit the changes and push to your own repository
- Notify the examiner ([email protected]) that work is complete specifying the Github repository, First Name, Last Name and Matriculation number. This needs to happen at least 7 days prior an exam registration date.
- https://rogerdudler.github.io/git-guide/
- http://therandomsecurityguy.com/openvswitch-cheat-sheet/
- https://www.cyberciti.biz/faq/howto-linux-configuring-default-route-with-ipcommand/
- https://www.vagrantup.com/intro/getting-started/
According to the assignment requirements. I have created one disposable vagrant file to fulfill the desired requirements. Design is very simple; there are six Linux virtual machines, we have configured them with the help of vagrant as two routers, one OpenVswitch, and Three hosts. One host is acting as a Web Server.
Host-A and Host-B are on different networks:
Host-A Network and Required addresses are 119. We have more usable IP addresses that can be used in the future.
- Network ID: 172.16.8.0
- Subnet Mask: 255.255.252.0
- Broadcast Address: 172.16.11.255
- IP address range: 172.16.8.1 - 172.16.11.254
Host-B Network and Required addresses are 513. We have more usable IP addresses that can be used in the future.
- Network ID: 172.16.12.0
- Subnet Mask: 255.255.252.0
- Broadcast Address: 172.16.15.255
- IP address range: 172.16.12.1 - 172.16.15.254
Host-C Network and Required addresses are 271. Here we have less usable Ip addresses, but we can use a different network. But for test purposes use this network.
- Network ID: 172.16.2.0
- Subnet Mask: 255.255.255.0
- Broadcast Address: 172.16.2.255
- IP address range: 172.16.2.1 - 172.16.2.254
Network for Router-1 and Router-2 :
- Network ID: 172.16.4.8
- Subnet Mask: 255.255.255.252
- Broadcast Address: 172.16.4.11
- IP address range: 172.16.4.9 - 172.16.4.10
Network for Switch, In order to connect the router and switch we use a different network.
- Network ID: 172.16.3.0
- Subnet Mask: 255.255.255.240
- Broadcast Address: 172.16.3.15
- IP address range: 172.16.3.1 - 172.16.3.14
For the Switch, we have used OpenVSwitch, to configure we created three bridges. On every bridge we added a port and assign an IP address. configuration can be find in Vagrant file.
How we define the Routes for all the machines. One can easily find in the vagrant file.
On Host-C we have configured a Web-Server that can easily access from client Host-A and Host-B. To access the web-server we have used the "Lynx" text-based web browser on terminals. One can easily access using this command in the terminal. (lynx http:// [ip address of web-browser]). If you see in the Vagrant file we also successfully installed Lynx-Browser but unfortunately, we had a specific vagrant error then it stoped all the configuration for other machines in the line. So, we suggest you can install manually this browser just by entering the command in terminal "sudo apt-get install -y lynx" and later to access the web-browser as we mentioned the command above "lynx http:// [ip address of web-browser]".