10.1 (Conspect)NetworkSetup

Opening a VM:

By entering the " ip "command, we get a list of two network interfaces: "loopback" and"eth0". Each has an assigned ip address.

Command "ip addr add dev eth0 192.168.1.2/24" will create another network address on the interface "eth0", the subnet mask will be 24 bits. This setting will not be saved after restarting.

Disable network support and clean the routing table. Now let's restore the settings that were made using the commands:

  1. ip link sert dev eth0 up - присваивается атрибут UP
  2. ip address add dev eth0 10.0.2.15/24 - теперь сетевому интерфейсу присвоен ip-адрес

Now the network is configured as TCP-ip on this machine,BUT only within the local network.

To make a machine a router enter the following command: "tp route add default via 192.168.11.2". This will not work because this machine (192.168.11.2) is not a router and any external packet will be "lost" in it. To fix this, you need to assign the machine as a router: "sysctl net.ipv4.ip_forward=1".

In this case, we won't get a response to do this - we need to enable firewall: "iptables -t nat -A postrouting -o eth0 -j MASQUERADE"

What happens here when using masquerade technology:

All packets that do not come from us "turn" into packets that come from us. After that, they go to the Internet with our ip address, return back, and are converted by the firewall back.

After that, the Internet will start working, including the browser. It is very difficult to configure this manually every time, so there are several subsystems for configuring the network (we will not discuss them because there is neither time nor sense). Network Manager is a "daemon" that operates in terms of " connecting to...". By manipulating the settings of the network Manager, we can recreate the connection that we created with our hands. The only thing is that you can't configure firewall.

The Network Manager has a command line that allows you to manage it.

etc / net is just a system of shell scripts and chunks of configuration files for the services that should be running.

HSE/ArchitectureOS/10_NetworkSetup/Conspect_en (последним исправлял пользователь VasilyKireenko 2020-06-10 01:42:38)