指定固定IP
说明:直接修改配置文件来指定IP,并可以连接到外网(程序员推荐)
编辑:
#vim /etc/sysconfig/network-scripts/ifcfg-eth0 #ConOS
vim /etc/network/interfaces #Ubuntu
要求:将IP地址配置成静态的,ip地址为192.168.184.130
vim /etc/network/interfaces
#静态分配的配置方法
auto eth0
iface eth0 inet static
address 192.168.0.1
netmask 255.255.255.0
gateway 192.168.0.1
#保存退出
#重启网络服务
service network restart