系统开机初始页面
打开终端(terminal)
切换ROOT用户
普通用户状态下
sudo su
ROOT用户模式
查看当前IP
ip a
网卡名为:eth0
打开网卡配置文件(Linux一切皆是文件)
vi /etc/network/interfaces
网卡初始页面
设置静态IP
eth0 代表网卡名,通过上面的第二步可以查出
iface eth0 inet static 设置网卡为静态的
address 设置IP
netmask 子网掩码
gateway 网关
auto eth0
iface eth0 inet static
address 192.168.80.80
netmask 255.255.255.0
gateway 192.168.80.254
正常保存并退出
按下键盘左上角,ESC 在英文状态下,输入
:wq
重启网卡
service networking restart