如何配置静态ip

接下来讲解一下如何配置静态ip,其实操作步骤并不是非常难,接下来我们学习一下。
首先修改root/etc/network/interfaces文件,修改内容如下:# Wired or wireless interfaces
auto eth0
iface eth0 inet static
address 192.168.2.100
netmask 255.255.255.0
gateway 192.168.2.1
broadcast 192.168.2.255
然后设置静态IP为192.168.2.100
在/etc/rc.local文件里加入/etc/init.d/networking restart
修改后内容如下:
echo 30000 > /proc/sys/vm/min_free_kbytes
/etc/init.d/networking restart
exit 0
重新启动后,静态IP设置完成。

点赞