
etc/network/interfaces 是 Debian 系統中最為重要的網路設定檔案,許多網路介面的設定都是透過這個檔案。
詳細說明:ifupdown - DebianWiki
如果是 dhcp,可以寫成:
auto lo
iface lo inet loopback
auto eth0
iface eth0 inet dhcp$ sudo vi /etc/resolv.conf
nameserver 168.95.192.1
nameserver 168.95.1.1$ sudo vi /etc/network/interfaces
# 開機時,自動啟用 localhost 及 eth1 這兩個網路設定
auto lo eth1
# 開機啟用: 「localhost」
iface lo inet loopback
# 使 eth0 這個網卡自動取得 IP
iface eth0 inet dhcp
# 使 eth1 使用固定 IP
iface eth1 inet static
#網址
address 163.26.108.129
#遮罩
netmask 255.255.255.128
#網段代表號
network 163.26.108.128
#廣播
broadcast 163.26.108.255
#路由器位置
gateway 163.26.108.254restart your network:
$ sudo /etc/init.d/networking restart
詳細資訊:
發表新回應