vim /etc/network/interfaces编辑网网卡配置文件

auto lo
auto eth0  #开机自动连接网络
iface lo inet loopback
allow-hotplug eth0
iface eth0 inet static   #static表示使用固定ip,dhcp表述使用动态ip
address 192.168.21.166   #设置ip地址
netmask 255.255.255.0  #设置子网掩码
gateway 192.168.21.2    #设置网关

发表回复

您的电子邮箱地址不会被公开。 必填项已用*标注

Captcha Code