- 1 安装ubuntu
- 2 步骤:
[email protected]:~$ sudo vi /etc/network/interfaces
i进入编辑 设置成固定ip
auto eth0
iface eth0 inet static
address 192.168.1.223
netmask 255.255.255.0
gateway 192.168.1.1
esc退出编辑 “:wq”保存退出。“shif+z+z”保存退出。“:q!”强制退出
linux命令运行中间强制退出命令“ctrl+c”
- 3 重新启动网络
[email protected]:~$ sudo /etc/init.d/networking restart
- 4 显示
* Running /etc/init.d/networking restart is deprecated because it may not enable again some interfaces
* Reconfiguring network interfaces...
ssh stop/waiting
ssh start/running, process 12552
...done.
- 5 通过 ping www.baidu.com 测试网络
- 6 更新软件列表
会首先更新源
[email protected]:~$ sudo apt-get update
时间: 2024-10-27 18:42:38