修改/etc/network/interfaces文件 sudo gedit /etc/network/interfaces 贴出我的eth0设置,自己看情况修改: # The primary network interface auto eth0 #iface eth0 inet dhcp iface eth0 inet static address 45(ip地址) netmask 255.255.255.0(子网掩码) gateway (网关)
iface eth0 inet static address 10 netmask 255.255.255.0 gateway