码迷,mamicode.com
首页 > 系统相关 > 详细

嵌入式linux下MF825C上网

时间:2017-09-14 23:51:00      阅读:365      评论:0      收藏:0      [点我收藏+]

标签:嵌入式linux下mf825c上网

中兴MF825C电信版

插上usb网卡后

#lsusb

19d2:1225 (bus 1, device 3)

0000:0000 (bus 1, device 1)

网卡会自动模式转换

#lsusb

19d2:1405 (bus 1, device 3)

0000:0000 (bus 1, device 1)

在内核上选择支持它的驱动模块

技术分享

确保这三个模块都有rndis_host.ko,cdc_ether.ko,usbnet.ko然后添加驱动

#modprobe rndis_host

会根据依赖关系挂载相应的模块

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)

如果驱动没问题就会看到usb0的虚拟网卡

#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。

本文出自 “Linux_woniu” 博客,请务必保留此出处http://llu1314.blog.51cto.com/5925801/1965269

嵌入式linux下MF825C上网

标签:嵌入式linux下mf825c上网

原文地址:http://llu1314.blog.51cto.com/5925801/1965269

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!