LoginSignup
1
4

More than 5 years have passed since last update.

GL-AR150とL-02CでLTEモバイルルータを作ってみた

Last updated at Posted at 2018-08-18

はじめに

GL Technologies & Microuter Technologies社のルータは標準でOpenWRTを実装しています。
GL-AR150L-02Cを使いLTEモバイルルータを作ってみました。SIMカードはLINEモバイルを使います。

GL-AR150の仕様

  • Atheros 9331 SoC, 400MHz CPU
  • 150Mbps
  • 16MB Flash, 64M RAM
  • OpenWRTプレインストール
  • USBポート x 1
  • GPIOポート x 4
  • 省電力、超小型、安い、分解しやすい

これだけのスペックならいろいろできますよ。

GL-AR150の初期設定をします

1.GL-AR150の裏蓋にWi-FiのSSIDとKEY(パスワード)が表示されているのでパソコンから接続し、ブラウザで http://192.168.8.1/ に接続します。

2.言語は【English】を選択します。

3.標準時は【Asia/Tokyo】を選択します。

4.パスワードを設定します。

5.下記画面が表示されます。GL-AR150本体のスイッチボタンを【Left】(ルータモード)に変更します。

6.Wi-Fiパスワードを設定します。その後、新しいWi-Fiパスワードで再接続します。

7.上位ルータ(192.168.3.1)と接続しインターネット接続できるようWANポートを設定します。メンテナンス用として設定します。

8.上位ルータとGL-AR150 WANポートをLANケーブルで接続すると、WANポートがアクティブになります。

9.ファームウェアを最新版にアップグレードします。

10.ファームウェアのアップグレードが終わり、一度セッションが切れます。

11.もう一度GL-AR150に接続しログインします。

12.GL-AR150にsshできるようにします。

$ ssh root@192.168.8.1
The authenticity of host '192.168.8.1 (192.168.8.1)' can't be established.
RSA key fingerprint is SHA256:xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added '192.168.8.1' (RSA) to the list of known hosts.
root@192.168.8.1's password: 


BusyBox v1.25.1 () built-in shell (ash)

     _________
    /        /\      _    ___ ___  ___
   /  LE    /  \    | |  | __|   \| __|
  /    DE  /    \   | |__| _|| |) | _|
 /________/  LE  \  |____|___|___/|___|                      lede-project.org
 \        \   DE /
  \    LE  \    /  -----------------------------------------------------------
   \  DE    \  /    Reboot (17.01.4, r3560-79f57e422d)
    \________\/    -----------------------------------------------------------

root@GL-AR150:~# 

13.上位ルータ(192.168.3.1)で、GL-AR150ネットワーク(192.168.8.0)への経路設定をします。

属性
ネットワーク・アドレス 192.168.8.0
サブネットマスク 255.255.255.0
ゲートウェイ 192.168.3.8
メトリック 1

GL-AR150にL-02Cを接続し、LINEモバイルのAPN設定をします

1.必要なパッケージをインストールします。

root@GL-AR150:~# opkg update
root@GL-AR150:~# opkg install comgt kmod-usb-serial kmod-usb-serial-option kmod-usb-serial-wwan usb-modeswitch
root@GL-AR150:~# opkg install kmod-usb-net kmod-usb-net-rndis kmod-usb-net-cdc-ether usbutils udev
root@GL-AR150:~# opkg install luci-proto-3g
root@GL-AR150:~# halt

2.GL-AR150にL-02Cを挿入し、WANポートのLANケーブルを外して、電源を入れ直します。

3.L-02Cを認識しているか、設定内容を確認します。

$ ssh root@192.168.8.1
root@192.168.8.1's password: 

root hubR150:~# lsusb
Bus 001 Device 003: ID 1004:618f LG Electronics, Inc. Ally/Optimus One
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub

root@GL-AR150:~# dmesg | grep ttyUSB
[   18.379276] usb 1-1: GSM modem (1-port) converter now attached to ttyUSB0
[   18.392167] usb 1-1: GSM modem (1-port) converter now attached to ttyUSB1
[   18.405031] usb 1-1: GSM modem (1-port) converter now attached to ttyUSB2
[   18.417804] usb 1-1: GSM modem (1-port) converter now attached to ttyUSB3

root@GL-AR150:~# gcom info -d /dev/ttyUSB2
##### Wireless WAN Modem Configuration #####
Trying list of devices
Product text:

NTT DOCOMO, INC.
OK
====
Manufacturer:           LG Electronics Inc
IMEI and Serial Number: xxxxxxxxxxxxxxx
Manufacturer's Revision: 
L02C-MDM9200-V10e-Jun-11-2014-DCM-
Hardware Revision:

Network Locked:         

Customisation:          

Band settings:          (
)
APN:
##### END #####

4./etc/config/networkを設定します。'3g'を追加します。

root@GL-AR150:~# cp -p /etc/config/network /etc/config/network.org

root@GL-AR150:~# vi /etc/config/network
### Add 9 lines at the end of the file
config interface '3g'
        option proto '3g'             
        option service 'umts'         
        option apn 'line.me'          
        option username 'line@line'   
        option password 'line'        
        option device '/dev/ttyUSB2'  
        option pppd_options 'noipdefault'
        option demand '0'

5./etc/config/firewallを設定します。'3g'の追加と、GL-AR150ネットワーク(192.168.3.0)周りの設定をします。

root@GL-AR150:~# cp -p /etc/config/firewall /etc/config/firewall.org
root@GL-AR150:~# vi /etc/config/firewall
config zone                    
        option name 'wan'
### Modify 1 line ###
#       option input 'REJECT'
        option input 'ACCEPT'
##########################
        option output 'ACCEPT'
        option forward 'REJECT'
### Add 1 line ###
        option masq_dest '!192.168.3.0/24'
##################
        option masq '1'     
        option mtu_fix '1'   
### Modify 1 line ###
#       option network 'wan wan6'
        option network 'wan wan6 3g'
#####################

### Add 3 lines ###
config forwarding
        option src 'wan'                                   
        option dest 'lan'
###################

6./etc/chatscripts/3g.chatを設定します。LINEモバイルへのAPN接続設定をした後、再起動します。

root@GL-AR150:~# cp -p /etc/chatscripts/3g.chat /etc/chatscripts/3g.chat.org
root@GL-AR150:~# vi /etc/chatscripts/3g.chat
ABORT   BUSY
ABORT   'NO CARRIER'
ABORT   ERROR
REPORT  CONNECT
TIMEOUT 10
""      "ATZ"
OK      "ATH"
OK      "ATQ0 V1 E1 S0=0 &C1 &D2 +FCLASS=0"
OK      'AT+CGDCONT=1,"IP","line.me"'
SAY     "Calling UMTS/GPRS"
TIMEOUT 30
OK      "ATD*99***1#"
CONNECT ' '

root@GL-AR150:~# reboot

7.インターフェース'3g-3g'を確認します。

$ ssh root@192.168.8.1
192.168.8.1's password:
root@GL-AR150:~# ifconfig 3g-3g
3g-3g     Link encap:Point-to-Point Protocol  
          inet addr:xx.xx.xxx.xxx  P-t-P:xx.xx.xx.xx  Mask:255.255.255.255
          UP POINTOPOINT RUNNING NOARP MULTICAST  MTU:1500  Metric:1
          RX packets:416 errors:0 dropped:0 overruns:0 frame:0
          TX packets:592 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:3 
          RX bytes:71691 (70.0 KiB)  TX bytes:387335 (378.2 KiB)

8.経路情報を確認します。

root@GL-AR150:~# route
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
default         xx.xx.xx.xx     0.0.0.0         UG    0      0        0 3g-3g
default         192.168.3.1     0.0.0.0         UG    10     0        0 eth0
xx.xx.xx.xx     *               255.255.255.255 UH    0      0        0 3g-3g
192.168.3.0     *               255.255.255.0   U     10     0        0 eth0
192.168.8.0     *               255.255.255.0   U     0      0        0 br-lan

さいごに

GL-AR150はOpenWRTdd-wrtも簡単に利用できるようになります。やったね。GPIOポートを上手に使えたらいいな、と思ってる今日この頃です(=^・^=)

参考情報

ありがとうございました。

1
4
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
4