Sobes.tech
Junior — Middle

How is the configuration of network interfaces and services carried out in Linux systems?

sobes.tech AI

Answer from AI

Configuring network interfaces and services in Linux is usually done through configuration files and commands.

For configuring interfaces:

  • Systems with systemd use networkd or NetworkManager.
  • Configuration can be stored in /etc/network/interfaces (Debian-like) or in files in /etc/sysconfig/network-scripts/ (RedHat-like).

Example of static IP configuration in /etc/network/interfaces:

auto eth0
iface eth0 inet static
    address 192.168.1.100
    netmask 255.255.255.0
    gateway 192.168.1.1

To manage interfaces, you can use commands:

  • ip addr — view and configure addresses.
  • ip link — manage interfaces.
  • ifconfig — deprecated but still used sometimes.

For configuring services:

  • systemctl is used to start, stop, and manage services.
  • Service configurations are usually in /etc/systemd/system/ or /lib/systemd/system/.

Example of starting a service:

sudo systemctl start nginx
sudo systemctl enable nginx

Thus, configuration involves editing configuration files and managing services via systemd or other init systems.

How is the configuration of network interfaces and… - sobes.tech