ubuntu 修改密码;我使用的Ubuntu Server 14
1、修改配置文件
ip配置文件:/etc/network/interfaces
iface eth0 inet static
address 192.168.12.104
gateway 192.168.12.255
netmask 255.255.255.0
2、命令行设置
sudo ifconfig eth0 192.168.12.104 netmask 255.255.255.0
将IP地址改为:192.168.12.104,子网掩码改为:255.255.255.0
3.Ubuntu IP设置网关
sudo route add default gw 192.168.12.255
重启网卡:
sudo /etc/init.d/networking restart
如果没有生效 就使用 ifdown eth0 ; ifup eth0;
sudo ifdown eth0;
sudo ifup eth0;
如果还提没有网卡;就是没有启动服务:
service networking start [stop restart]