Debian 8 9 10 11 添加/新增/修改/多IP 配置网卡 配置IP

Debian 11 配置IP

  1. 网卡配置文件:/etc/network/interfaces
  2. 假设当前IP 192.168.1.5 需配置IP 192.168.1.6
  3. 文件内必要参数:
    auto lo
    iface lo inet loopback
    
    auto eth3
    iface eth3 inet static
        address 192.168.1.5
        netmask 255.255.255.0
        gateway 192.168.1.1
        dns-nameservers 223.5.5.5 114.114.114.114
  4. 多IP配置文件内容如下:
    auto lo
    iface lo inet loopback
    
    auto eth3
    iface eth3 inet static
        address 192.168.1.5
        netmask 255.255.255.0
        gateway 192.168.1.6
        dns-nameservers 223.5.5.5 114.114.114.114
    auto eth3:0
    iface eth3:0 inet static
        address 192.168.1.6
        netmask 255.255.255.0
    
  5. 重启网卡:service networking restart
THE END