手机看片精品高清国产日韩,色先锋资源综合网,国产哺乳奶水91在线播放,乱伦小说亚洲色图欧洲电影

Debian系統下配置網絡

2019-11-11 17:26:04 14342

Debian系統的網絡配置和其他一些系統的過程是一樣的,包括配置IP、網關和DNS等等,本文就來簡單介紹一下Debian系統下配置網絡的過程。


1、設置IP地址、網關

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

vi /etc/network/interfaces # 編輯網網卡配置文件

# The loopback network interface

auto lo

iface lo inet loopback

# The primary network interface

auto eth0 # 開機自動連接網絡

allow-hotplug eth0

iface eth0 inet static # static表示使用固定ip,dhcp表述使用動態ip

address 192.168.21.166 # 設置ip地址

netmask 255.255.255.0 # 設置子網掩碼

gateway 192.168.21.2 # 設置網關

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

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

# 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、設置dns

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

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

nameserver 127.0.0.1

nameserver 8.8.8.8 # 設置首選dns

nameserver 8.8.4.4 # 設置備用dns

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

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

nameserver 127.0.0.1

nameserver 8.8.8.8

nameserver 8.8.4.4

3、重啟網絡

service networking restart # 重啟網絡

至此,IP地址、網關、DNS配置完成,現在系統已經可以上網了。

以上就是Debian系統下進行網絡配置的方法了,IP地址、網關和DNS設置,每一步都不能省略哦。


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

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

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

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