ubuntu 修改网卡名

sudo nano /etc/default/grub
****
找到GRUB_CMDLINE_LINUX=""
改为GRUB_CMDLINE_LINUX=***"net.ifnames=0 biosdevname=0 "*****然后**
sudo grub-mkconfig -o /boot/grub/grub.cfg

重启后,网卡名称 变成了eth0和wlan0

重启后没有enth0 无法ping

问题
ifconfig 没有eth0 但 ifconfig -a 有。

解决方法:
是需要本地网卡驱动启动 ifconfig enth0 up

修改 /etc/network/interfaces 加入eth0配置

然后sudo /etc/init.d/networking restart 或在sudo systemclt networing restart
但有错误 :
[…] Restarting networking (via systemctl): networking.serviceJob for networking.service failed because the control process exited with error code.
See “systemctl status networking.service” and “journalctl -xe” for details

看提示输入 systemctl status networking.service
看状态详细信息 问题 :Unknown interface etho
要ifconfig看有没有eth0信息sudo ifup eth0 启动网卡
$ifconfig -a eth0 显示IP
sudo ifup eth0

**ii@ii-ThinkPad-Edge-E431:~$ sudo nano /etc/network/interfaces
ii@ii-ThinkPad-Edge-E431:~$ sudo /etc/init.d/networking restart**
[....] Restarting networking (via systemctl): networking.serviceJob for networking.service failed because the control process exited with error code.
See "systemctl status networking.service" and "journalctl -xe" for details.failed!
**ii@ii-ThinkPad-Edge-E431:~$ systemctl status networking.service**
● networking.service - Raise network interfacesLoaded: loaded (/lib/systemd/system/networking.service; enabled; vendor preset: enabled)Active: failed (Result: exit-code) since Tue 2022-04-05 10:34:38 CST; 3s agoDocs: man:interfaces(5)Process: 4413 ExecStart=/sbin/ifup -a --read-environment (code=exited, status=1/FAILURE)Process: 4411 ExecStartPre=/bin/sh -c [ "$CONFIGURE_INTERFACES" != "no" ] && [ -n "$(ifquery --read-environment --list --exclude=lo)" ] &&Main PID: 4413 (code=exited, status=1/FAILURE)4月 05 10:34:38 ii-ThinkPad-Edge-E431 systemd[1]: Starting Raise network interfaces...
4月 05 10:34:38 ii-ThinkPad-Edge-E431 sh[4411]: Unknown interface etho
4月 05 10:34:38 ii-ThinkPad-Edge-E431 ifup[4413]: Unknown interface etho
4月 05 10:34:38 ii-ThinkPad-Edge-E431 systemd[1]: networking.service: Main process exited, code=exited, status=1/FAILURE
4月 05 10:34:38 ii-ThinkPad-Edge-E431 systemd[1]: networking.service: Failed with result 'exit-code'.
4月 05 10:34:38 ii-ThinkPad-Edge-E431 systemd[1]: Failed to start Raise network interfaces.**ii@ii-ThinkPad-Edge-E431:~$ sudo ifup eth0
ii@ii-ThinkPad-Edge-E431:~$ sudo ifconfig**
eth0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500inet 192.168.22.10  netmask 255.255.255.0  broadcast 192.168.22.255inet6 fe80::2ad2:44ff:fe67:4443  prefixlen 64  scopeid 0x20<link>ether 28:d2:44:67:44:43  txqueuelen 1000  (以太网)RX packets 86  bytes 6293 (6.2 KB)RX errors 0  dropped 0  overruns 0  frame 0TX packets 44  bytes 7153 (7.1 KB)TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0lo: flags=73<UP,LOOPBACK,RUNNING>  mtu 65536inet 127.0.0.1  netmask 255.0.0.0inet6 ::1  prefixlen 128  scopeid 0x10<host>loop  txqueuelen 1000  (本地环回)RX packets 6912  bytes 597255 (597.2 KB)RX errors 0  dropped 0  overruns 0  frame 0TX packets 6912  bytes 597255 (597.2 KB)TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0rename13: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500inet 192.168.239.224  netmask 255.255.255.0  broadcast 192.168.239.255inet6 fe80::8b3a:df83:89e8:c9b0  prefixlen 64  scopeid 0x20<link>ether ea:58:32:4a:cf:53  txqueuelen 1000  (以太网)RX packets 16904  bytes 12967730 (12.9 MB)RX errors 0  dropped 0  overruns 0  frame 0TX packets 16615  bytes 3110099 (3.1 MB)TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0**ii@ii-ThinkPad-Edge-E431:~$ systemctl status networking.service**
● networking.service - Raise network interfacesLoaded: loaded (/lib/systemd/system/networking.service; enabled; vendor preset: enabled)Active: failed (Result: exit-code) since Tue 2022-04-05 10:34:38 CST; 1min 32s agoDocs: man:interfaces(5)Process: 4413 ExecStart=/sbin/ifup -a --read-environment (code=exited, status=1/FAILURE)Process: 4411 ExecStartPre=/bin/sh -c [ "$CONFIGURE_INTERFACES" != "no" ] && [ -n "$(ifquery --read-environment --list --exclude=lo)" ] &&Main PID: 4413 (code=exited, status=1/FAILURE)4月 05 10:34:38 ii-ThinkPad-Edge-E431 systemd[1]: Starting Raise network interfaces...
4月 05 10:34:38 ii-ThinkPad-Edge-E431 sh[4411]: Unknown interface etho
4月 05 10:34:38 ii-ThinkPad-Edge-E431 ifup[4413]: Unknown interface etho
4月 05 10:34:38 ii-ThinkPad-Edge-E431 systemd[1]: networking.service: Main process exited, code=exited, status=1/FAILURE
4月 05 10:34:38 ii-ThinkPad-Edge-E431 systemd[1]: networking.service: Failed with result 'exit-code'.
4月 05 10:34:38 ii-ThinkPad-Edge-E431 systemd[1]: Failed to start Raise network interfaces.

ubuntu 修改网卡名相关推荐

  1. ubuntu修改网卡名

    直接修改为ethx 执行命令 sudo gedit /etc/default/grub 进入后将画线部分修改为 GRUB_CMDLINE_LINUX="net.ifnames=0 biosd ...

  2. Linux Ubuntu 修改网卡名字

    Linux Ubuntu 修改网卡名字 一.写在前面 这篇文章主要介绍了,Linux Ubuntu 系统下通过以下两种方式修改网卡的名字,这里根据自己的实际操作验证,从中学习记录,方便后续查询. 邮箱 ...

  3. linux修改网卡名(亲测有效)

    1查看网卡ip addr 2cd /etc/sysconfig/network-scripts Ls查看 3mv ifcfg-eno16777736 ifcfg-eth0重命名,然后编辑 最后一行加入 ...

  4. 戴尔服务器安装centos7修改网卡名,Centos7.6修改网卡名称为之前的eth形式

    1.修改网卡配置文件中名称信息 vim /etc/sysconfig/network-scripts/ifcfg-ens33将其中的名称为ens33的改为eth0 2.对网卡文件进行重命名mv  /e ...

  5. MSFT_NetAdapter修改网卡名

    修改网卡名,使用powershell命令即可,如果在多种语言环境,就要考虑编码问题.有什么方法可以省掉编码转换呢 powershell Rename-NetAdapter -Name "cu ...

  6. Linux7 修改网卡名eth0

    前言:部署软件时,发现需要网卡名为eth0,但Linux7版本以上网卡名默认不是eth0,故这里总结一下修改网卡名的方法. 一.Linux7版本修改网卡名(通用操作) 1.查看网卡名,找到mac地址( ...

  7. linux之修改静态ip,修改网卡名称为eth0,以及iso装系统后的配置ip

    Linux修改静态ip 方案一: 1.  # cd /etc/sysconfig/network-scripts/ 2.# vim ifcfg-eth0 添加更改黄匡内容 这时候如果想修改成静态的,首 ...

  8. openfiler修改ip的命令_为openfiler存储磁盘命名,修改网卡名,以及多路径绑定

    一:为磁盘命名 查询sdb磁盘信息:udevadm info --query all --name=sdb vim /etc/udev/rules.d/70-persistent-iscsi.rule ...

  9. ubuntu修改账户名、密码和电脑名

    Ubuntu更改密码步骤: 1.进入Ubuntu,打开一个终端,输入 sudo su转为root用户. 2.sudo passwd user(user 是对应的用户名) 3.输入新密码,确认密码. 4 ...

最新文章

  1. HDU 1273 漫步森林
  2. 动网论坛数据库字段表说明
  3. 谷歌、亚马逊的顶级GPU被质疑太贵了!这种CPU算法竟然快15倍
  4. 初中参观机器人博物馆的作文_2021考研英语二大作文模板整理
  5. Microsoft Office Access ActiveX 部件不能创建对象
  6. CentOS 7.0关闭默认防火墙启用iptables防火墙
  7. 计算机组成原理平均cpi怎么算_计算机组成原理--1.2计算机系统性能评价
  8. hdu4821 字符串hash(有多少(M*L长的,M个不相同)子串))
  9. 服务容错、限流、资源隔离、熔断、监控…3天,撸完了!
  10. 汉中计算机培训班学费是多少,汉中远程教育培训班收费多少
  11. 编程贺卡c语言,C++实现新年贺卡程序
  12. 链路追踪php,easyswoole链路追踪
  13. C语言简单的练习题目——牛生牛
  14. FFT变换频谱图中幅值的设置方法
  15. linux中LCD之framebuffer设备驱动
  16. Java对图片Base64转码--HTML对Base64解码
  17. 技术胖--前端学习html5表单美化部分笔记
  18. react骨架屏自动生成_网页骨架屏自动生成方案(dps)
  19. c语言数组文曲星猜数游戏编程,第7章 数组-8数组的其他应用——文曲星猜数游戏...
  20. Apex Lightning Salesforce 学习笔记及报错问题(持续更新)

热门文章

  1. ansa导出NASTRAN的nas文件报错:warning: MATERIAL(s) were not output(undefined)
  2. js逆向 万博体育登录
  3. 优秀的企业领导人二十个好习惯
  4. STM32新建工程所需文件介绍
  5. DeLong测试 计算两个ROC曲线之间的统计意义
  6. 标记肽Bz-Pro-Phe-Arg-pNA、59188-28-2
  7. Matlab系列之运算符和标点符号的功能介绍
  8. IT30: IT经理与CIO的技能差别
  9. SAP中QM收货检验批无法正常质检判定问题处理实例
  10. 非学不可的“VLAN和三层交换”(实践是检验真理的唯一标准)