谷动谷力

 找回密码
 立即注册
谷动谷力 首页 嵌入式 查看内容

OpenWRT EC20 4G网卡应用自动拔号配置方法 

2022-7-12 21:47| 发布者: 鸣涧| 查看: 174| 评论: 0|原作者: 鸣涧

摘要: OpenWRT 4G网卡自动拔号配置方法  查看是否驱动成功(驱动移植是收费服务有需求可以联系) ls /dev复制代码 添加端口wwan0 vim /etc/config/network复制代码 config interface 'loopback' option ifname 'lo' ...
OpenWRT 4G网卡自动拔号配置方法 

查看是否驱动成功(驱动移植是收费服务有需求可以联系我们)
  1. ls /dev
复制代码


open4G.png


添加端口wwan0
  1. vim /etc/config/network
复制代码

  1. config interface 'loopback'
  2.         option ifname 'lo'
  3.         option proto 'static'
  4.         option ipaddr '127.0.0.1'
  5.         option netmask '255.0.0.0'

  6. config globals 'globals'
  7.         option ula_prefix 'fd59:a22b:2bea::/48'

  8. config interface 'lan'
  9.         option type 'bridge'
  10.         option _orig_ifname 'eth0.1 ra0'
  11.         option _orig_bridge 'true'
  12.         option proto 'dhcp'
  13.         option ifname 'eth0.1 ra0'
  14.         option hostname 'gateway'

  15. config switch
  16.         option name 'switch0'
  17.         option reset '1'
  18.         option enable_vlan '1'

  19. config switch_vlan
  20.         option device 'switch0'
  21.         option vlan '1'
  22.         option ports '0 1 2 3 6t'

  23. config switch_vlan
  24.         option device 'switch0'
  25.         option vlan '2'
  26.         option ports '4 6t'

  27. config interface 'wwan'
  28.         option proto 'dhcp'
  29.         option ifname 'wwan0'
复制代码



重启网关

  1. reboot
复制代码



4G网卡

拨号命令
  1. uqmi -d /dev/cdc-wdm0 --start-network internet --autoconnect
复制代码



拨号查询命令
uqmi -d /dev/cdc-wdm0 --get-data-status

  1. root@TJ:/# uqmi -d /dev/cdc-wdm0 --get-data-status
  2. "connected"
复制代码
拔号成功

查看网络连接情况
  1. fconfig
  2. .....
  3. wwan0     Link encap:Ethernet  HWaddr C2:28:EB:4D:61:C8  
  4.           inet addr:10.7.104.115  Bcast:10.7.104.119  Mask:255.255.255.248
  5.           inet6 addr: fe80::c028:ebff:fe4d:61c8/64 Scope:Link
  6.           UP BROADCAST RUNNING NOARP MULTICAST  MTU:1500  Metric:1
  7.           RX packets:68 errors:0 dropped:0 overruns:0 frame:0
  8.           TX packets:482 errors:0 dropped:0 overruns:0 carrier:0
  9.           collisions:0 txqueuelen:1000
  10.           RX bytes:10735 (10.4 KiB)  TX bytes:125275 (122.3 KiB)
复制代码



开机自动 4G 拨号上网

  1. vim /etc/rc.local
复制代码

exit0 前添加
  1. sleep 5
  2. uqmi -d /dev/cdc-wdm0 --start-network internet --autoconnect &
复制代码

整个内容:
  1. # Put your custom commands here that should be executed once
  2. # the system init finished. By default this file does nothing.
  3. /root/watch&
  4. sleep 5
  5. uqmi -d /dev/cdc-wdm0 --start-network internet --autoconnect &
  6. exit 0
复制代码
重启网关

  1. reboot
复制代码

再次查看网络连接情况
  1. fconfig
  2. .....
  3. wwan0     Link encap:Ethernet  HWaddr C2:28:EB:4D:61:C8  
  4.           inet addr:10.7.104.115  Bcast:10.7.104.119  Mask:255.255.255.248
  5.           inet6 addr: fe80::c028:ebff:fe4d:61c8/64 Scope:Link
  6.           UP BROADCAST RUNNING NOARP MULTICAST  MTU:1500  Metric:1
  7.           RX packets:68 errors:0 dropped:0 overruns:0 frame:0
  8.           TX packets:482 errors:0 dropped:0 overruns:0 carrier:0
  9.           collisions:0 txqueuelen:1000
  10.           RX bytes:10735 (10.4 KiB)  TX bytes:125275 (122.3 KiB)
复制代码

设置一切OK



鲜花

握手

雷人

路过

鸡蛋

相关阅读

发表评论

最新评论

最新热点

QQ|Archiver|手机版|深圳市光明谷科技有限公司|光明谷商城|Sunshine Silicon Corpporation ( 粤ICP备14060730号|Sitemap

GMT+8, 2024-3-21 14:36 , Processed in 0.183619 second(s), 37 queries .

Powered by Discuz! X3.2 Licensed

© 2001-2013 Comsenz Inc.

返回顶部