因为校园网客户端的原因,需要修改电脑的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 的话 没有最上面那个
自问自答。
没有用命令行,是图形化操作
右上角 System Setting --> network -->选择你正在使用的网卡(Wired)--> options(选项)-->Ethernet(以太网)-->Cloned MAC address : ::::(你想要的MAC地址)-->重启**
发现一个非常厉害的 Ubuntu 问答社区 AskUbuntu.com ,基本上我遇到的问题都能在上面找到答案,可惜知道的晚了。