como posso modificar meu endereço MAC para sempre no Ubuntu?

0

Eu tenho que modificar meu endereço MAC do Ubuntu por algum motivo. através do google, eu escolho editar o arquivo /etc/network/interfaces .

Antes de editar (o conteúdo do arquivo):

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

Depois da edição:

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

#(Way 1)  I have tried to edit these three lines.
#auto enp1s0   
#iface enp1s0 inet static
#hwaddress ether 30:65:EC:32:48:D3

#(Way 2)  I have tried to edit these two lines ,too.
#auto enp1s0
#iface enp1s0 inet dhcp*

#(Way 3)
iface enp1s0 inet static
pre-up ifconfig enp1s0 hw ether 30:65:EC:32:48:D3

Mas quando eu reinicio o computador, não consigo encontrar o meu enp1s0.

a saída para ifconfig :

 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)

Saída para 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)

Acho que meu arquivo de configuração estava errado, mas não sei como corrigi-lo.

Alguma sugestão?

    
por shuiRong Lin 01.01.2017 / 13:49

0 respostas