国产欧美日韩第一页|日本一二三不卡视频|在线精品小视频,亚洲第一免费播放区,metcn人体亚洲一区,亚洲精品午夜视频

Debian系統(tǒng)下配置網(wǎng)絡(luò)

2019-11-11 17:26:04 15227

Debian系統(tǒng)的網(wǎng)絡(luò)配置和其他一些系統(tǒng)的過程是一樣的,包括配置IP、網(wǎng)關(guān)和DNS等等,本文就來簡單介紹一下Debian系統(tǒng)下配置網(wǎng)絡(luò)的過程。


1、設(shè)置IP地址、網(wǎng)關(guān)

cp /etc/network/interfaces /etc/network/interfaces.bak # 備份原有配置文件

vi /etc/network/interfaces # 編輯網(wǎng)網(wǎng)卡配置文件

# The loopback network interface

auto lo

iface lo inet loopback

# The primary network interface

auto eth0 # 開機自動連接網(wǎng)絡(luò)

allow-hotplug eth0

iface eth0 inet static # static表示使用固定ip,dhcp表述使用動態(tài)ip

address 192.168.21.166 # 設(shè)置ip地址

netmask 255.255.255.0 # 設(shè)置子網(wǎng)掩碼

gateway 192.168.21.2 # 設(shè)置網(wǎng)關(guān)

按 ESC 鍵,然后輸入 :eq 保存并退出。

下面的版本便于復(fù)制, 因為配置文件里最好不要有中文:

# 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、設(shè)置dns

cp /etc/resolv.conf /etc/resolv.conf.bak # 備份原有dns配置文件

vi /etc/resolv.conf # 編輯配置文件

nameserver 127.0.0.1

nameserver 8.8.8.8 # 設(shè)置首選dns

nameserver 8.8.4.4 # 設(shè)置備用dns

按 ESC 鍵,然后輸入 :eq 保存并退出。

下面的版本便于復(fù)制, 因為配置文件里最好不要有中文:

nameserver 127.0.0.1

nameserver 8.8.8.8

nameserver 8.8.4.4

3、重啟網(wǎng)絡(luò)

service networking restart # 重啟網(wǎng)絡(luò)

至此,IP地址、網(wǎng)關(guān)、DNS配置完成,現(xiàn)在系統(tǒng)已經(jīng)可以上網(wǎng)了。

以上就是Debian系統(tǒng)下進行網(wǎng)絡(luò)配置的方法了,IP地址、網(wǎng)關(guān)和DNS設(shè)置,每一步都不能省略哦。


提交成功!非常感謝您的反饋,我們會繼續(xù)努力做到更好!

這條文檔是否有幫助解決問題?

非常抱歉未能幫助到您。為了給您提供更好的服務(wù),我們很需要您進一步的反饋信息:

在文檔使用中是否遇到以下問題: