linux - Ubuntu|开机ifconfig没有eth0只有lo和无线,之前修改过/etc/network/interfaces 中的信息

 围脖上的博博_771 发布于 2022-10-31 17:03

过程是这样的:

  • 因为校园网客户端的原因,需要修改电脑的MAC地址。

  • 根据教程改了/etc/network/interfaces 中的信息:

原本是:

# interfaces(5) file used by ifup(8) and ifdown(8)
auto lo
iface lo inet loopback

改成这样了:

# interfaces(5) file used by ifup(8) and ifdown(8)
auto lo
iface lo inet loopback

#试过下面这三行命令
#auto enp1s0   
#iface enp1s0 inet static
#hwaddress ether 30:65:EC:32:48:D3

#也试过下面这两行命令
#auto enp1s0
#iface enp1s0 inet dhcp*

#现在用的是这个
iface enp1s0 inet static
pre-up ifconfig enp1s0 hw ether 30:65:EC:32:48:D3

现在:

ifconfig -a

enp1s0    Link encap:Ethernet  HWaddr 40:8d:5c:a5:5c:c2  
          BROADCAST MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)

lo        Link encap:Local Loopback  
          inet addr:127.0.0.1  Mask:255.0.0.0
          inet6 addr: ::1/128 Scope:Host
          UP LOOPBACK RUNNING  MTU:65536  Metric:1
          RX packets:889 errors:0 dropped:0 overruns:0 frame:0
          TX packets:889 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1 
          RX bytes:83096 (83.0 KB)  TX bytes:83096 (83.0 KB)

wlx24050f8df94e Link encap:Ethernet  HWaddr 24:05:0f:8d:f9:4e  
          inet addr:10.233.170.5  Bcast:10.233.191.255  Mask:255.255.224.0
          inet6 addr: fe80::6654:7773:3b38:85bc/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:4091 errors:0 dropped:0 overruns:0 frame:0
          TX packets:4995 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:2714584 (2.7 MB)  TX bytes:839383 (839.3 KB)

ifconfig 的话 没有最上面那个

#怎么永久修改MAC地址成 30:65:EC:32:48:D3 和解决上面的问题?

1 个回答
  • 自问自答。
    没有用命令行,是图形化操作

    右上角 System Setting --> network -->选择你正在使用的网卡(Wired)--> options(选项)-->Ethernet(以太网)-->Cloned MAC address : ::::(你想要的MAC地址)-->重启**  

    发现一个非常厉害的 Ubuntu 问答社区 AskUbuntu.com ,基本上我遇到的问题都能在上面找到答案,可惜知道的晚了。

    2022-10-31 22:44 回答
撰写答案
今天,你开发时遇到什么问题呢?
立即提问
热门标签
PHP1.CN | 中国最专业的PHP中文社区 | PNG素材下载 | DevBox开发工具箱 | json解析格式化 |PHP资讯 | PHP教程 | 数据库技术 | 服务器技术 | 前端开发技术 | PHP框架 | 开发工具 | 在线工具
Copyright © 1998 - 2020 PHP1.CN. All Rights Reserved 京公网安备 11010802041100号 | 京ICP备19059560号-4 | PHP1.CN 第一PHP社区 版权所有