Home  >  Q&A  >  body text

linux - Ubuntu|开机ifconfig没有eth0只有lo和无线,之前修改过/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 和解决上面的问题?

ringa_leeringa_lee2742 days ago790

reply all(1)I'll reply

  • ringa_lee

    ringa_lee2017-04-17 16:30:25

    Ask and answer your own questions.
    No command line is used, it is a graphical operation

    System Setting in the upper right corner --> network -->Select the network card you are using (Wired) --> options -->Ethernet (Ethernet) -->Cloned MAC address: ::::(MAC address you want)-->Restart** 

    I found a very powerful Ubuntu question and answer community AskUbuntu.com. Basically, I can find answers to all the questions I encountered on it. Unfortunately, I found out about it too late.

    reply
    0
  • Cancelreply