首先切換到root用戶:sudo su
修改網絡配置文件:vi /etc/network/interfaces
---配置一個ip靜態ip地址,配置如下:
auto lo
iface lo inet loopback
auto eth0
iface eth inet static
address 192.168.1.11
netmask 255.255.255.0
gateway 192.168.1.1
如果eth0是自動獲取IP,那么配置如下
auto lo
iface lo inet loopback
auto eth0
iface eth0 inet dhcp
---配置兩個網絡
auto eth0
iface eth0 inet static
address 192.168.0.13
netmask 255.255.225.0
auto eth1
iface eth1 inet static
address 192.168.1.22
netmask 255.255.225.0
gateway 192.168.1.1
