Ubuntu20 修改网卡名称
Ubuntu 修改网卡名称
Ubuntu修改网卡名称
Ubuntu 版本: Ubuntu 20.04
查看当前网卡名称
root@it:~# ip add
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
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: ens32: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UP group default qlen 1000
link/ether 00:0c:29:2d:79:40 brd ff:ff:ff:ff:ff:ff
inet 192.168.121.21/24 brd 192.168.121.255 scope global ens32
valid_lft forever preferred_lft forever
inet6 fe80::20c:29ff:fe2d:7940/64 scope link
valid_lft forever preferred_lft forever
- 在 /etc/default/grub 文件中编辑
- GRUB_CMDLINE_LINUX 引号中添加参数 net.ifnames=0 biosdevname=0

4、修改完后执行命令 update-grub
root@it:~# update-grub
Sourcing file `/etc/default/grub'
Sourcing file `/etc/default/grub.d/init-select.cfg'
Generating grub configuration file ...
Found linux image: /boot/vmlinuz-5.4.0-62-generic
Found initrd image: /boot/initrd.img-5.4.0-62-generic
done
5、在 /etc/netplan/00-installer-config.yaml 文件中修改网卡名为传统名称 eth0
- 注意:如果是Ubuntu 16或一下版本,则是在 /etc/network/interfaces 文件中修改
root@it:~# sed -i "s/ens32/eth0/" /etc/netplan/00-installer-config.yaml
root@it:~# cat /etc/netplan/00-installer-config.yaml
# This is the network config written by 'subiquity'
network:
ethernets:
eth0:
addresses:
- 192.168.121.21/24
gateway4: 192.168.121.2
nameservers:
addresses:
- 8.8.8.8
version: 2
- 重启
root@it:~# reboot
重启后,查看网卡名称
it@it:~$ ip add
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
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 fq_codel state UP group default qlen 1000
link/ether 00:0c:29:2d:79:40 brd ff:ff:ff:ff:ff:ff
inet 192.168.121.21/24 brd 192.168.121.255 scope global eth0
valid_lft forever preferred_lft forever
inet6 fe80::20c:29ff:fe2d:7940/64 scope link
valid_lft forever preferred_lft forever
- OK,修改成功
Ubuntu20 修改网卡名称的更多相关文章
- linux修改网卡名称
本文转载自江一<linux修改网卡名称> 终端输入:vi /etc/udev/rules.d/70-persistent-net.rules 出现以下文件 # This file was ...
- Linux修改网卡名称、主机名
Linux修改网卡名称.主机名 环境:VirtualBox 5.0.14 + RHEL 6.5 需求:个人实验搭建一套Standby RAC时,为了节约时间,直接复制之前安装RAC的主机模板. 但复制 ...
- CentOS 7.2修改网卡名称
#!/bin/bash #Centos7.2修改网卡名称ens33为eth0 #2017/05/19 if [ -f /etc/sysconfig/grub ];then cd cp /etc/sys ...
- ubuntu修改网卡名称ensX为eth0
1.sudo nano /etc/default/grub 找到GRUB_CMDLINE_LINUX="" 改为GRUB_CMDLINE_LINUX="net.ifnam ...
- CentOS 7修改网卡名称
CentOS 7 修改网卡名为eth0 标签: linux 笔者Q:972581034 交流群:605799367.有任何疑问可与笔者或加群交流 CentOS7的网卡名称太长,这不符合我们的使用习惯, ...
- Linux修改网卡名称的方法
假设我们要修改网卡名为mybridge 实现步骤如下 1.# vim /etc/modprobe.conf 找到alias eth0 vmxnet 将eth0改为你想要的网卡名称 例: alias m ...
- centos7.5 修改网卡名称
1.修改网卡配置文件中名称信息 vim /etc/sysconfig/network-scripts/ifcfg-ens33 将其中的名称为ens33的改为eth0 ,并将uuid删除以便后面克隆 2 ...
- Centos7.2 修改网卡名称
查看ip [root@localhost network-scripts]# ip addr : lo: <LOOPBACK,UP,LOWER_UP> mtu qdisc noqueue ...
- L09-Linux系统修改网卡名称(eth1修改为eth0)
一.环境 VirtualBox + CentOS6.5 二.问题 有时候在克隆服务器之后配置网络时,或者在维护别人建好的服务器时,会遇到这样一种情况.如下图所示: 即:在接口配置文件ifcfg-e ...
随机推荐
- 【论文笔记】Learning Fashion Compatibility with Bidirectional LSTMs
论文:<Learning Fashion Compatibility with Bidirectional LSTMs> 论文地址:https://arxiv.org/abs/1707.0 ...
- HTML(〇):简介导读
网页 什么是网页 网站(Website):是指在因特网上根据一定的规则,使用HTML(标准通用标记语言)等工具制作的用于展示特定内容相关网页的集合. 网页(webpage):是网站中的一页,通常是HT ...
- Dynamics CRM各个版本的元数据浏览解决方案
https://docs.microsoft.com/en-us/dynamics365/customerengagement/on-premises/developer/browse-your-me ...
- BUAA_OO_第四单元
一.UML解析器设计 先看下题目:第四单元实现一个基于JDK 8带有效性检查的UML(Unified Modeling Language)类图,顺序图,状态图分析器 MyUmlInteractio ...
- mp4视频中插入文字
最近接到一个需求,需要往mp4中动态插入文字,并且mp4中的乌云能在文字上有飘动的效果,一开始想用canvas,但是由于本人经验不足,没什么思路,看到css3有一个属性:mix-blend-mode, ...
- Dynamic Programming 动态规划入门笔记
算法导论笔记 programming 指的是一种表格法,并非编写计算机程序 动态规划与分治方法相似,都是通过组合子问题的解来求解原问题.但是分治法将问题划分为互不相交的子问题.而动态规划是应用与子问题 ...
- jasypt-spring-boot提示Failed to bind properties
1 问题描述 在Spring Boot中使用jasypt-spring-boot进行加密,但是提示: Description: Failed to bind properties under 'spr ...
- 如何识别自己基因组数据是哪个全基因组参考版本(Genome Reference Versions/ Genome Build)
首先在这里先感谢我们[Bio生信学习交流群]的群友和创建此群的群主[陈博士后]. 今天解决的问题是怎么查看自己的基因组数据是哪个Genome Reference Versions. 步骤: 第一步,打 ...
- 支持多线程的Redis6.0来了
支持多线程的 Redis 6.0 版本于 2020-05-02 终于发布了,为什么 Redis 忽然要支持多线程?如何开启多线程?开启后性能提升效果如何?线程数量该如何设置?开启多线程后会不会有线程安 ...
- [VSC] HTML打叹号无法自动提示默认框架
一般的, 在 VSC 中编辑 HTML 文档时, 打一个叹号 '!', 就会提示, 可生成默认代码, 如: 采纳建议后, 是这样: 问题: 如果出现打叹号无法出现提示的情况, 首先, 请检查当前的语言 ...