在Ubuntu下查看IP的命令为ifconfig
设置固定IP地址
sudo vim /etc/network/interfaces
修改iface eth0 inet dhcp 为 iface eth0 inet static
并在这句后添加
address 192.168.1.1
netmask 255.255.255.0
gateway 192.168.1.254
dns-nameservers 8.8.8.8
保存退出后使用如下命令重启网络服务
/etc/init.d/networking restart
浙公网安备 33010602011771号