1、ip的配置
编辑interfaces文件
路径: /etc/network/interfaces
命令行输入:vim /etc/network/interfaces
得到如下内容
# The primary network interface
allow-hotplug eth0
#iface eth0 inet dhcp 动态dhcp分配IP(用#注释掉了)
iface eth0 inet static 静态IP
address 192.168.0.201 IP地址
netmask 255.255.255.0 子网掩码
network 192.168.0.0 网段
broadcast 192.168.0.255 广播地址
gateway 192.168.0.1 网关
# dns-* options are implemented by the resolvconf package, if installed
dns-nameservers 192.168.0.1 DNSF服务器地址
dns-search localhost
重启网络服务:
/etc/init.d/networking restart