How to configure network under Debian system

  
                

The network configuration of the Debian system is the same as that of some other systems, including configuring IP, gateway, DNS, etc. This article will briefly introduce the process of configuring the network under the Debian system.

1, set the IP address, gateway

cp /etc /network /interfaces /etc/network/interfaces.bak # backup the original configuration file

vi /etc/network/interfaces # Edit Network Adapter Profile

# The loopback network interface

auto lo

iface lo inet loopback

# The primary Network interface

auto eth0 # Boot automatically connect to the network

allow-hotplug eth0

iface eth0 inet static # static means to use fixed ip, dhcp representation using dynamic ip

address 192.168.21.166 # Set ip address

netmask 255.255.255.0 # Set subnet mask

gateway 192.168.21.2 #Set gateway

Press ESC, Then type: eq to save and exit.

The following version is easy to copy, because it is best not to have Chinese in the configuration file:

# The loopback network interface

auto lo

iface lo inet Loopback

# The primary network interface

auto eth0

allow-hotplug eth0

iface eth0 inet static

address 192.168.21.166

netmask 255.255.255.0

gateway 192.168.21.1

2, set dns

cp /etc/resolv.conf /etc/resolv.conf. Bak # back up the original dns configuration file

vi /etc/resolv.conf #edit configuration file

nameserver 127.0.0.1

nameserver 8.8.8.8 # set preferred dns< Br>

nameserver 8.8.4.4 # Set up alternate dns

Press ESC, then type: eq to save and exit.

The following version is easy to copy, because it is best not to have Chinese in the configuration file:

nameserver 127.0.0.1

nameserver 8.8.8.8

nameserver 8.8 .4.4

3. Restart the network

service networking restart # Restart the network

At this point, the IP address, gateway, and DNS configuration are complete, and the system is now available online.

The above is the method of network configuration under Debian system, IP address, gateway and DNS settings, each step can not be omitted.

Copyright © Windows knowledge All Rights Reserved