刚把debian装好的时候,网络配置文件/etc/network/interfaces是这样子的:
#This file describes the network interfaces available on your system
#and how to activate them. For more information, see interfaces(5).
#The loopback network interface
auto lo
iface lo inet loopback
lo是本地回环网络,所有电脑127.0.0.1就是指的它,至于如何上网配置固定ip得我在早一点的blog中曾经很简单的写了几笔如何配置,但是通过最近一段时间的摸索发现那样的配置是很不规范的,现在把该文件的详细配置及其注释写出来,供debian的朋友参考,也供自己备份查询。
说明几点:
1、主网络接口,我的理解是要么是dhcp(动态获得ip)要么是静态ip模式,所以二者只能配置其一,我现在使用的是dhcp模式,所以把静态ip的设置注释掉了。也许2者可以同时配置,有兴趣的同学不妨试试。
2、无线网络接口是要在配置好intel或者windows的驱动后才能起作用的。
3、PPPoE是宽带拨号方式,网上说和静态ip模式是一样的,我没有实验条件,所以不写出配置方式,免得误导。
4、还有一种是使用56kbps电话线拨号上网的配置,应当也是dhcp模式的,但是非常不好意思的说我也是没有配置出来,因为我的t41内置的modem我一直没能驱动上。这个可以等驱动上以后再写出来。
#This file describes the network interfaces available on your system
#and how to activate them. For more information, see interfaces(5).
#This file is modified by Jackie on Apr 4th, 2008.
####LO##########
#The loopback network interface(配置环回口)
#开机自动激lo接口
auto lo
#配置lo接口为环回口
iface lo inet loopback
#####DHCP#########
#The primary network interface (配置主网络接口)
#开机自动激活eth0接口
auto eth0
#配置eth0接口为DHCP自动获取
iface eth0 inet dhcp
####Static IP###
#The primary network interface (配置主网络接口)
#开机自动激活eth0接口
#auto eth0
#配置eth0接口为静态设置IP地址
#iface eth0 inet static
#address 128.1.1.94
#netmask 255.255.255.0
#gateway 192.168.109.1
#####WLAN#####
#The wireless network interface (配置无线网络接口)
#开机自动激活wlan0接口
auto wlan0
#配置wlan0接口为DHCP自动获取
iface wlan0 inet dhcp
####PPPoE####
#The PPPoE network interface (配置宽带接口)