Network configuration on Linux

RMAG news

This is how a network needs to be configured when spinning up a linux server. For example for a fresh install of a local lab on of linux virtual machines on VMware Fusion, Virtualbox or AWS, etc. These are some of the technical details that need to be verified and configured properly.

Host Address: The unique IP address of your system on the network.

Network Subnet Address: Defines the local network’s range.

Default Router/Gateway: The device that routes traffic to other networks.

System Host Name: The name by which a system is identified on a network.

DNS Server Address: Used for resolving hostnames to IP addresses.

Network Configuration Files:

Linux systems use systemd-networkd service for network interface detection and configuration.
Different distributions have different files for network settings, such as:

Debian-based: /etc/network/interfaces

Red Hat-based: /etc/sysconfig/network-scripts directory

OpenSUSE: /etc/sysconfig/network

Configuration Methods:

Manual Editing: Directly modify network configuration files.

Graphical Tools: Use distribution-provided GUI tools.

Command-Line Tools: Utilize terminal commands for configuration.

Examples:

Static Configuration (Debian): Assigns IP and IPv6 addresses to eth0.

DHCP Configuration (Debian): Automatically obtains IP settings from a DHCP server.

Netplan (Ubuntu 17.04+): Uses YAML files in /etc/netplan for network settings.

Red Hat Configurations:

Interface Settings: Defined in files like ifcfg-enp0s3.

Network File: Specifies host name and default gateway.

Hostname: Set using hostnamectl or stored in /etc/hostname.

DNS Configuration: Managed by systemd-resolved or set in /etc/resolv.conf.

Local Hosts: Add entries manually in /etc/hosts for faster resolution.

Network Manager Tool: Provides a GUI for network settings and updates configuration files accordingly.