Debian修改IP、DNS

IP地址設置: /etc/network/interface

// 動態DHCP獲得

# 啓動系統激活設備
# Loop迴環地址
auto lo
iface lo inet loopback

# 啓動系統激活設備
# 網卡eth0設置爲DHCP類型
auto eth0
iface eth0 inet dhcp

// 靜態Static獲得

# 啓動系統激活設備
# Loop迴環地址
auto lo
iface lo inet loopback

# 啓動系統激活設備
# 網卡eth0設置爲Static類型
auto eth0
iface eth0 inet static

# 指定IP地址、子網掩碼、網關
address 192.168.0.1
netmask 255.255.255.0
gateway 192.168.0.1

注:在配置IP地址參數時,“// 動態DHCP獲得”和“// 靜態Static獲得”只能取其中的一種,二者不能同時存在,切記!!!

========================

DNS服務器設置: /etc/resolv.conf
# 必須設置.否則無法訪問任何URL

nameserver 202.103.0.117

nameserver 211.95.193.97

========================

重啓網卡

/etc/init.d/networking restart
ifdown eth0
ifup eth0
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章