> 技术文档 > 如何修改debian的ip地址

如何修改debian的ip地址

  1. 编辑配置文件:
    sudo nano /etc/network/interfaces
  2. 修改内容(示例将 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 退出
  3. 重启网络服务:
    sudo systemctl restart networking #
    sudo ifdown eth0 && sudo ifup eth0