参考文档:http://www.linuxdiyf.com/viewarticle.php?id=85304
初始文件:
# 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
使用静态IP,加入以下内容(将地址,子网掩码,网关换成你要设定的值)
# Static IP
auto eth0
iface eth0 inet static
address 10.0.1.250
netmask 255.255.0.0
gateway 10.0.0.1
使用DHCP
# DHCP
auto eth0
iface eth0 inet dhcp