在linux中通过 /etc/network/interfaces 配置静态ip
在linux中通过 /etc/network/interfaces 配置静态ip
·
- 查看网卡设备
sudo ifconfig
这里假设我的网卡设备是 eth0 和 eth1
- 打开配置文件
sudo vi /etc/network/interfaces
- 向配置文件添加如下内容
auto eth0
iface eth0 inet static
address 192.168.100.2
netmask 255.255.255.0
auto eth1
iface eth1 inet static
address 192.168.100.3
netmask 255.255.255.0
- 保存并退出
Esc
:wq
- 重启网络服务
sudo systemctl restart networking
- 确认ip已生效
sudo ifconfig
完成。

魔乐社区(Modelers.cn) 是一个中立、公益的人工智能社区,提供人工智能工具、模型、数据的托管、展示与应用协同服务,为人工智能开发及爱好者搭建开放的学习交流平台。社区通过理事会方式运作,由全产业链共同建设、共同运营、共同享有,推动国产AI生态繁荣发展。
更多推荐
所有评论(0)