SM1: Open-source operating systems
ASIX/DAW/DAM-1 Task A3: Basic Network Configuration
04-10-24

Task A3: Basic Network Configuration

GENERAL CONDITIONS
Deadline DAW1: On 13-10-25 teacher will check that your operating system is working properly   
Deadline ASIX1: On 16-10-24 teacher will check that your operating system is working properly

DOCUMENTATION

a)  About networking
1-
Linux network interface: https://www.baeldung.com/linux/network-interface-configure#what-is-a-network-interface
2-
Basic network concepts (IP address, mask, gateway and DNS): https://www.dipolnet.com/what_is_the_ip_address_network_mask_gateway__bib538.htm
3- MAC (or hardware) address: https://slts.osu.edu/articles/whats-a-mac-address-and-how-do-i-find-it/
4- Linux ip command examples: https://www.cyberciti.biz/faq/linux-ip-command-examples-usage-syntax/
5- Setting a Default Gateway: https://www.cyberciti.biz/faq/howto-debian-ubutnu-set-default-gateway-ipaddress/
6- Removing a Default Gateway: https://www.baeldung.com/linux/ip-remove-default-gateway
7- Bridge adapter vs NAT:https://medium.com/@megops/comparing-networking-solutions-in-virtualbox-nat-nat-network-host-network-and-bridged-network-5edb99d7c33b
8- Linux Network Manager: https://linuxconfig.org/linux-gui-network-managers

b) Comands examples

1- dacomo@inf1-dacomo:~$ ip a   # It shows interface name, IP address and subnet mask in CIDR (modern) format

2- dacomo@inf1-dacomo:~$ ip r   # It show the gateway (router) IP address.

3- dacomo@inf1-dacomo:~$ cat /etc/resolv.conf   # It shows the DNS IP addresses.

4- dacomo@inf1-dacomo:~$ sudo ip a del 192.168.5.10/23 dev enp0s3   # It removes IP address = 192.168.5.10 with subnet mask = 23 from device enp0s3

5- dacomo@inf1-dacomo:~$ sudo ip a add 172.16.1.210/21 dev enp0s3   # It adds IP address = 172.16.1.1210 with subnet mask = 21 to device enp0s3

6- dacomo@inf1-dacomo:~$ sudo ip a del 192.168.1.10/22 dev enp0s3   # It removes IP address = 192.168.1.10 with subnet mask = 22 from device enp0s3

7- dacomo@inf1-dacomo:~$
sudo ip route add default via 172.16.1.1   # It sets a default router IP address to 172.16.1.1

8- dacomo@inf1-dacomo:~$ sudo ip route  del default via 192.168.1.1   # It removes a default router IP address equal to 192.168.1.1


c) About sudo


When you install Debian, a default account is created called root. This user has full system access and should be used only for administrative tasks. There are basically no restrictions on what you can do to your system as the root user, which is powerful, but extremely dangerous. To alleviate this risk, we can let some users to execute single commands as root.. The command sudo allows you running programs with the security privileges of root.

The benefits of using sudo instead of su - root are the following:
Debian allows users that are member of a group called sudo to run commands with the help of the command sudo. In order to add a user to the group sudo:
The moment you are member of sudo, you can run commands with the root privileges just adding sudo before the command. The system will ask for your password (no the root password).

The default timeout of sudo is 5 minutes; that is, Linux will remember your password for 5 minutes by default.

In order to check if you are member of the group sudo run the following command: id . This command shows a list of groups you are member of. If  27(sudo) appears then,you are member of the sudo group.


PRACTICAL EXERCISE

PART ONE: WORKING WITH BRIDGE ADAPTER ON VIRTUALBOX

1.- Change on VirtualBox the parameter Attached to of the Network configuration section to Bridge Adapter.
2.- Select your wireless card as interface to work as a bridge between your virtual computer and the network.
3.- Boot your virtual computer

PART TWO: ADDING YOUR USER TO THE GROUP SUDO

1.- 
Add your user to the group sudo.
2.-  Check that your user is member of the group sudo.

PART THREE:  SHOWING YOUR NETWORK CONFIGURATION. TESTING CONNECTIVITY


1
.- With the help of  Network Manager shows clearly:
    a) Network Interface identifier of your network card.
    b)
MAC
(or hardware) address of your network card.
    c)
IP address of your computer.
    d) IP address of the Gateway (Router) on your local network.
    e) IP addresses of the primary and secondary DNS servers queried by computers on your local network.

2.-
With the help of  Network Manager shows clearly the  configuration Method of your computer.

3.-
With the help of  commands shows clearly:
    a) T
he ethernet interface identifier.
    b)
MAC (or hardware) address of your ethernet interface.
    c)
IP address of your computer
.
    d)
IP address of the Gateway (Router) on your local network.
    e)
IP addresses of the primary and secondary DNS servers queried by computers on your local network.

4
.- With the help of  commands tests the connectivity of your computer to:
   
a)  www.google.com. Is there connectivity?. How do you know it?.
    b) IP address 7.7.7.7.
Is there connectivity?. Why?.

5.-
Find out the public IP address of www.google.com.


 

PART FOUR:  BASIC MANAGEMENT OF YOUR NETWORK SETTINGS WITH NETWORK MANAGER

1
.- Manually configure your ethernet interface using Network Manager:

2.- With  the help of  Network Manager shows clearly the  network configuration of your virtual computer.

3.- With the help of commands shown clearly:
    a) T
he ethernet interface identifier.
    b)
MAC (or hardware) address of your ethernet interface.
    c)
IP address of your computer
.
    d)
IP address of the Gateway (Router) on your local network.
    e)
IP addresses of the primary and secondary DNS servers queried by computers on your local network.
 


PART FIVE:  BASIC MANAGEMENT OF YOUR NETWORK SETTINGS WITH COMMANDS

1
.- Stop the Network manager. Run: sudo systemctl stop NetworkManager


2.-  Configure your Ethernet inteface:

3.- With the help of commands shown clearly:
    a) IP address of your computer
.
    b)
IP address of the Gateway (Router) on your local network.


PART SIX:  RETURN TO THE INITIAL CONDITIONS OF THE NETWORK CONFIGURATION

1.-
Start
again the Network manager. Run: sudo systemctl start NetworkManager

2.- Configure again  your  network interface  using the  Automatic (DHCP) method with the help of Network Manager.

3- Show again the network configuration with the help of Network manager.



PART SEVEN:  CHECKING YOUR CONFIGURATION

1- VirtualBox is attached to your physical wireless card
2- Your user is member of sudo
3- Shows your configuration with Network Manager. What is your IP address?
4- Shows your configuration with commands. What is the IP address of the Router?
5- Test connectivity to google.com. Is there connectivity or not?. Why?.

6- Test connectivity to 7.7.7.7. Is there connectivity or not?. Why?.
7.- What is the IP address of google.com?
8.- Change your Network configuration with Network Manager according to the settings asked in the Fourth part. Show the new configuration using commands.
9.- Change
your Network configuration with commands according to the settings in the asked in the Fifth part. Show the new configuration using commands.
10.- Return to the initial conditions of the network configuration.
Show the new configuration using Network Manager.