溫馨提示×

您好,登錄后才能下訂單哦!

密碼登錄×
登錄注冊(cè)×
其他方式登錄
點(diǎn)擊 登錄注冊(cè) 即表示同意《億速云用戶服務(wù)條款》

嵌入式linux下MF825C上網(wǎng)

發(fā)布時(shí)間:2020-06-28 13:45:48 來(lái)源:網(wǎng)絡(luò) 閱讀:1140 作者:Linux_woniu 欄目:系統(tǒng)運(yùn)維

中興MF825C電信版

插上usb網(wǎng)卡后

#lsusb

19d2:1225 (bus 1, device 3)

0000:0000 (bus 1, device 1)

網(wǎng)卡會(huì)自動(dòng)模式轉(zhuǎn)換

#lsusb

19d2:1405 (bus 1, device 3)

0000:0000 (bus 1, device 1)

在內(nèi)核上選擇支持它的驅(qū)動(dòng)模塊

嵌入式linux下MF825C上網(wǎng)

確保這三個(gè)模塊都有rndis_host.ko,cdc_ether.ko,usbnet.ko然后添加驅(qū)動(dòng)

#modprobe rndis_host

會(huì)根據(jù)依賴關(guān)系掛載相應(yīng)的模塊

rndis_host              6048  0 

cdc_ether               4992  1 rndis_host

usbnet                 14160  2 rndis_host,cdc_ether

#ifconfig -a

usb0     Link encap:Ethernet  HWaddr 36:4B:50:B7:EF:61  

          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1

          RX packets:4923 errors:0 dropped:0 overruns:0 frame:0

          TX packets:6229 errors:0 dropped:0 overruns:0 carrier:0

          collisions:0 txqueuelen:1000 

          RX bytes:1287334 (1.2 MiB)  TX bytes:1315840 (1.2 MiB)

如果驅(qū)動(dòng)沒(méi)問(wèn)題就會(huì)看到usb0的虛擬網(wǎng)卡

#ifconfig usb0 up

#udhcpc -i usb0 -s /sbin/udhcpc.sh -p /var/run/udhcpc.pid

udhcpc (v1.12.1) started

Sending select for 192.168.0.133...

Lease of 192.168.0.133 obtained, lease time 86400

deleting routers

route: ioctl 0x890c failed: No such process

adding dns 192.168.0.1

igmpproxy, Version 0.1 beta2, Build 160601 

Copyright 2005 by Johnny Egeland <johnny@rlo.org>

#ifconfig usb0

usb0      Link encap:Ethernet  HWaddr 36:4B:50:B7:EF:61  

          inet addr:192.168.0.133  Bcast:192.168.0.255  Mask:255.255.255.0

          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1

          RX packets:24 errors:0 dropped:0 overruns:0 frame:0

          TX packets:27 errors:0 dropped:0 overruns:0 carrier:0

          collisions:0 txqueuelen:1000 

          RX bytes:4726 (4.6 KiB)  TX bytes:5766 (5.6 KiB)

#ping www.baidu.com

PING www.baidu.com (220.181.112.244): 56 data bytes

64 bytes from 220.181.112.244: seq=0 ttl=52 time=57.345 ms

64 bytes from 220.181.112.244: seq=1 ttl=52 time=53.074 ms

64 bytes from 220.181.112.244: seq=2 ttl=52 time=49.176 ms

到此OK。

向AI問(wèn)一下細(xì)節(jié)

免責(zé)聲明:本站發(fā)布的內(nèi)容(圖片、視頻和文字)以原創(chuàng)、轉(zhuǎn)載和分享為主,文章觀點(diǎn)不代表本網(wǎng)站立場(chǎng),如果涉及侵權(quán)請(qǐng)聯(lián)系站長(zhǎng)郵箱:is@yisu.com進(jìn)行舉報(bào),并提供相關(guān)證據(jù),一經(jīng)查實(shí),將立刻刪除涉嫌侵權(quán)內(nèi)容。

AI