主題 : Smart4418 WIFI網絡接口怎么樣才能自動命名為wlanX形式? 復制鏈接 | 瀏覽器收藏 | 打印
級別: 新手上路
UID: 143530
精華: 0
發帖: 1
金錢: 5 兩
威望: 1 點
貢獻值: 0 點
綜合積分: 2 分
注冊時間: 2019-12-17
最后登錄: 2019-12-18
樓主  發表于: 52天前

 Smart4418 WIFI網絡接口怎么樣才能自動命名為wlanX形式?

Smart4418 WIFI網絡接口不會自動命名為wlanX形式,而是wlx44d878eba2b5的形式,怎么做才好?
首先問題先說一下,是下面這樣的:[email protected]:~# insmod /home/wlan_mt7668_usb.ko
r
[email protected]:~# ifconfig -a
eth0      Link encap:Ethernet  HWaddr 0e:e3:bc:51:93:87  
          inet6 addr: fe80::e3b4:5ac1:af56:8c91/64 Scope:Link
          UP BROADCAST MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:7 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:0 (0.0 B)  TX bytes:842 (842.0 B)
          Interrupt:64 Base address:0x4000

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:6560 errors:0 dropped:0 overruns:0 frame:0
          TX packets:6560 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1
          RX bytes:485440 (485.4 KB)  TX bytes:485440 (485.4 KB)

wlx44d878eba2b5 Link encap:Ethernet  HWaddr 44:d8:78:eb:a2:b5  
          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)

網絡接口不是wlan0\wlan1那種形式,而是wlx44d878eba2b5 后來發現/etc/udev/rules.d/70-persistent-net.rules文件存在,但是空的。我從PC UBUNTU系統里拷了一個70-persistent-net.rules文件,放進去,并修改,重啟后是能成 wlan0的名稱。
這是修改過的:[email protected]:~# cat /etc/udev/rules.d/70-persistent-net.rules# This file was automatically generated by the /lib/udev/write_net_rules# program, run by the persistent-net-generator.rules rules file.## You can modify it, as long as you keep each rule on a single# line, and change only the value of the NAME= key.
# USB device 0x:0xSUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="44:d8:78:eb:a2:b5", ATTR{dev_id}=="0x0", ATTR{type}=="1", KERNEL=="wlan*", NAME="wlan0"
[email protected]:~# insmod /home/wlan_mt7668_usb.ko [email protected]:~# ifconfig -aeth0      Link encap:Ethernet  HWaddr 0e:e3:bc:51:93:87            inet6 addr: fe80::e3b4:5ac1:af56:8c91/64 Scope:Link          UP BROADCAST MULTICAST  MTU:1500  Metric:1          RX packets:0 errors:0 dropped:0 overruns:0 frame:0          TX packets:7 errors:0 dropped:0 overruns:0 carrier:0          collisions:0 txqueuelen:1000           RX bytes:0 (0.0 B)  TX bytes:842 (842.0 B)          Interrupt:64 Base address:0x4000 
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:240 errors:0 dropped:0 overruns:0 frame:0          TX packets:240 errors:0 dropped:0 overruns:0 carrier:0          collisions:0 txqueuelen:1           RX bytes:17760 (17.7 KB)  TX bytes:17760 (17.7 KB)
wlan0     Link encap:Ethernet  HWaddr 44:d8:78:eb:a2:b5            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)
問題來了,我拿這Smart4418 ARM板是要做生產檢驗的,檢驗生產的WIFI模塊是否OK的,這樣要先改文件再來改識別,根本就沒法給生產使用。但找來找去,都沒發現像 /lib/udev/write_net_rules類似的執行文件。有什么辦法可以讓這網絡接口名稱變成wlan0\wlan1那樣正常呢?

河南快3网