谷动谷力

 找回密码
 立即注册
查看: 2283|回复: 0
打印 上一主题 下一主题
收起左侧

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

[复制链接]
跳转到指定楼层
楼主
发表于 2022-3-14 17:36:12 | 只看该作者 |只看大图 回帖奖励 |倒序浏览 |阅读模式
OpenWRT 4G网卡自动拔号配置方法 

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




添加端口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-4-20 10:49 , Processed in 0.079002 second(s), 40 queries .

Powered by Discuz! X3.2 Licensed

© 2001-2013 Comsenz Inc.

快速回复 返回顶部 返回列表