Network Configuration of the Server

12006

In Debian systems, network configuration is typically located in the /etc/network/interfaces file. Below is a basic training document for network configuration:

1. View Current Network Configuration

Before we begin, we can use the ip a or ifconfig (the net-tools package must be installed first) command to view the current network configuration.

2. Open the Network Configuration File

Open the network configuration file using a text editor, for example, using the nano editor:

sudo nano /etc/network/interfaces

3. Basic Network Configuration

In this file, you can configure your network. Here is a basic example:

# The loopback network interface
auto lo
iface lo inet loopback

# The primary network interface
auto eth0
iface eth0 inet static
    address 192.168.1.2
    netmask 255.255.255.0
    gateway 192.168.1.1
    dns-nameservers 8.8.8.8 8.8.4.4

In this example, we configured a network interface named eth0. We set it to a static IP address, with the IP address being 192.168.1.2, the subnet mask being 255.255.255.0, the gateway being 192.168.1.1, and the DNS servers being 8.8.8.8 and 8.8.4.4.

4. Apply Network Configuration

After saving and closing the file, you can use the following command to restart the network service to apply the new configuration:

sudo /etc/init.d/networking restart

Alternatively, you can also restart your system.

5. Verify Network Configuration

After restarting the network service, you can use the ip a or ifconfig command to verify your new network configuration.

This is a basic training document for Debian network configuration. Please note that specific configurations may vary depending on your network environment and requirements.

When performing network configuration, ensure that you understand the meaning of each setting and that these settings align with your network environment and needs. Any changes made in the configuration file may affect your network connection, so it is best to seek professional help if you are uncertain.