网络配置文件/etc/network/interfaces
auto lo
iface lo inet loopback
auto eth0
iface eth0 inet static
address 192.168.1.2
netmask 255.255.255.0
gateway 192.168.1.1
address关键字指定IP地址
netmask指定子网掩码
gateway指定网关
重新启动网络以使其生效:
sudo /etc/init.d/networking restart