:::success
# INR Lab1: Networking Basics
### Name: Daniil Sinelnik
### Email: d.sinelnik@innopolis.university
:::
## Task 1: Tools
:::info
Install the needed dependencies for GNS3: QEMU/KVM, Docker and Wireshark.
Hint: Check that virtualization is enabled in your bios. Make sure that the user belongs to all the necessary groups after installing the tools.
Start a GNS3 project, configure the pre-installed Ubuntu Cloud Guest template. Check that you can start it.
What are the different ways you can configure internet access in GNS3? Test them with a single created VM and give a one-line description of each. What are the differences between them?
Bonus: show the difference between them on practice and test the connectivity.
:::
I have installed GNS3 using GNS3 docs and also installed GNS3 VM, it needs for virtual box.
After that install Ubuntu cloud guest using `Ubuntu 20.04` from [here](https://www.gns3.com/marketplace/appliances/ubuntu-cloud-guest).
<center>


</center>
After that we can see the logs of booting.
<center>


</center>
**Cloud Connection:** This method involves connecting your VM to a cloud object in GNS3, which acts like a gateway to the internet. It's like creating a virtual link to the outside world within your GNS3 environment.
**Local Host Connection:** With this approach, your VM taps into your computer's own network interface to access the internet. Essentially, it piggybacks on your host machine's connection.
**GNS3 VM Connection:** In this setup, you use the GNS3 VM itself as a gateway for your VM to reach the internet. Think of it as routing your VM's internet traffic through the GNS3 virtual machine.
**NAT Network Connection:** Here, Network Address Translation (NAT) comes into play. It allows your VM to access the internet through your host machine's network connection, but with the added benefit of translating IP addresses to ensure smooth communication.
Each method has its own way of setting up and managing network connections, but they all serve the same purpose: getting your VM online in your GNS3 setup.
## Task 2 Switching
:::info
1. Create the following topology in GNS3.
<center>

</center>
2. Install openssh-server on both VMs and nginx web server on the Web VM.
3. What is the IP of the mask corresponding to /28 ?
How many machines can you configure under this subnet? Explain it. 4. Configure the VMs with private static IPs under a /28 subnet.
5. Check that you have connectivity between them.
Hint: use ping, traceroute and mtr.
6. Make sure your web server is accessible from the Admin VM.
Hint: use curl or wget
:::
Topology that i have created in GSN3:
<center>
</center>
1. Install OpenSSH in Admin Virtual Machine:
<center>

</center>
2. Installing OpenSSH and `nginx` on the Web Virtual Machine.
```
sudo apt install nginx
systemctl status nginx
```
Install and make sure it's running
<center>

</center>
If an IP address has a mask /28, then the first 28 bits of this address are the bits of the subnetwork address. The rest 4 bits are reserved for the addresses of the hosts on this network. This makes the total number of addresses in this network equal to 2^4 = 16.
However, 2 addresses on the network are reserved. The first address is reserved to identify the network. The last address is the broadcast address, that is intended for messages that need to be delivered to all devices on the network. Therefore, the number of addresses that can actually be assigned to devices is 16 - 2 = 14.
**Configure the VMs with private static IPs under a /28 subnet.**
1. Changing `netplan/50-cloud-init.yml` to the following
<center>

</center>
**Check that you have connectivity between them.**
1. Pinging both
<center>

</center>
**Make sure your web server is accessible from trhe Admin VM**
1. Sending an HTTP request to Web VM using `curl`.
<center>

</center>
## Task 3 Routing
**Select a virtual Routing solution (Gateway) such as Mikrotik, PfSense, VyOS, Untanble, NG, OpenWrt, Cumulus VX**
For this part I decided to use the MikroTik solution. I have downloaded the appliance and the disk image files from [here](https://gns3.com/marketplace/appliances/mikrotik-cloud-hosted-router). And installed the appliance into GNS3:
<center>


</center>
**Change the topology as follows**
Here is the final topology:
<center>

</center>
**Connect your Gateway to the internet and to your workstation/laptop.**
1. `ip address add` and check that nodes can be pinged.
<center>

</center>
Gateway
<center>

</center>
For port forwarding we have to configure firewall
<center>

</center>
Connected to Web using `curl`
<center>

</center>
Connected to Admin using `ssh`
<center>

</center>