Debian10修改ens33网卡名为eth0

运维干货 2年前 (2022) 导航君
6 0 0
  • Debian10 修改网卡ens33eth0,而且修改网卡ip为静态ip
    1. 编辑文件引导文件
      # vi /etc/default/grub
      初始值
      GRUB_CMDLINE_LINUX=""
      修改为
      GRUB_CMDLINE_LINUX="net.ifnames=0 biosdevname=0"
    2. 重新生成一个开机文件引导文件,重启服务器
      # grub-mkconfig -o /boot/grub/grub.cfg
      # reboot
    3. 修改网卡配置地址
      # vi /etc/network/interfaces

      a)如果是dhcp自动配置

      原始值
      auto ens33
      iface ens33 inet dhcp
      修改为
      auto eth0
      iface eth0 inet dhcp

      b)如果是static手动配置

      原始值
      auto lo
      iface lo inet lookback
      auto ens33
      iface ens33 inet static
      address 192.168.1.122
      netmask 255.255.255.0
      gateway 192.168.1.2
      修改为
      auto lo
      iface lo inet lookback
      auto eth0
      iface eth0 inet static
      address 192.168.1.122
      netmask 255.255.255.0
      gateway 192.168.1.2

      4.重启网卡

      # systemctl  restart networking
版权声明:导航君 发表于 2022年6月16日 下午4:27。
转载请注明:Debian10修改ens33网卡名为eth0 | 第八网址导航

相关文章

暂无评论

暂无评论...