如何修改debian的ip地址
网友:Bloger
技术文档
2025-07-26 19:52:10
- 编辑配置文件:
sudo nano /etc/network/interfaces
- 修改内容(示例将 eth0 设为静态IP):
auto eth0
iface eth0 inet static
address 192.168.1.100
netmask 255.255.255.0
gateway 192.168.1.1
dns-nameservers 8.8.8.8 8.8.4.4 # DNS服务器
Shift+Y保存
Ctrl+X 退出
- 重启网络服务:
sudo systemctl restart networking #
或 sudo ifdown eth0 && sudo ifup eth0