您现在的位置是: 网站首页 >服务部署 服务部署

Debian9修改默认的网卡名称为eth0

admin2018年10月25日 14:55 Linux 275人已围观

# Debian9修改网卡为eth0 ```bash root@Samba96-21:/home/user# vim.tiny /etc/default/grub ``` ## 修改GRUB_CMDLINE_LINUX ```bash #GRUB_CMDLINE_LINUX="" GRUB_CMDLINE_LINUX="net.ifnames=0 biosdevname=0" ``` ## 重新生成grub引导配置文件 ```bash root@Samba96-21:/home/user# grub-mkconfig -o /boot/grub/grub.cfg Generating grub configuration file ... Found linux image: /boot/vmlinuz-4.9.0-4-amd64 Found initrd image: /boot/initrd.img-4.9.0-4-amd64 done ``` ## 重启系统启动网卡 ```bash ifup eth0 ``` ## 配置IP地址 ```bash root@Samba96-21:/home/user# vim.tiny /etc/network/interfaces # This file describes the network interfaces available on your system # and how to activate them. For more information, see interfaces(5). source /etc/network/interfaces.d/* # The loopback network interface auto lo iface lo inet loopback # The primary network interface # old:enp0s25 allow-hotplug eth0 iface eth0 inet static address 192.168.96.21/24 gateway 192.168.96.1 # dns-* options are implemented by the resolvconf package, if installed dns-nameservers 192.168.99.99 dns-search 21 DNS服务器: root@Samba96-21:/home/user# vim.tiny /etc/resolv.conf search 21 nameserver 192.168.99.99 ``` ## 查看IP ```bash root@Samba96-21:/home/user# ip -V ip utility, iproute2-ss161212 root@Samba96-21:/home/user# ip address 1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1 link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00 inet 127.0.0.1/8 scope host lo valid_lft forever preferred_lft forever inet6 ::1/128 scope host valid_lft forever preferred_lft forever 2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default qlen 1000 link/ether 00:21:9b:19:38:ad brd ff:ff:ff:ff:ff:ff inet 192.168.96.21/24 brd 192.168.96.255 scope global eth0 valid_lft forever preferred_lft forever inet6 fe80::221:9bff:fe19:38ad/64 scope link valid_lft forever preferred_lft forever ```

很赞哦! (5)

文章交流

  • emoji
0人参与,0条评论

当前用户

未登录,点击   登录

站点信息

  • 建站时间:网站已运行588天
  • 系统信息:Linux
  • 后台程序:Python: 3.6.6
  • 网站框架:Django: 2.2.9
  • 文章统计:222 篇
  • 文章评论:40 条
  • 腾讯分析网站概况-腾讯分析
  • 百度统计网站概况-百度统计
  • 微信公众号:扫描二维码,关注我们
返回
顶部
标题 换行 登录
网站