Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # まずは確認
- pi@raspberrypi:~$ ll /dev/tty [TAB]キーを押す
- tty tty17 tty26 tty35 tty44 tty53 tty62
- tty0 tty18 tty27 tty36 tty45 tty54 tty63
- tty1 tty19 tty28 tty37 tty46 tty55 tty7
- tty10 tty2 tty29 tty38 tty47 tty56 tty8
- tty11 tty20 tty3 tty39 tty48 tty57 tty9
- tty12 tty21 tty30 tty4 tty49 tty58 ttyAMA0
- tty13 tty22 tty31 tty40 tty5 tty59 ttyprintk
- tty14 tty23 tty32 tty41 tty50 tty6
- tty15 tty24 tty33 tty42 tty51 tty60
- tty16 tty25 tty34 tty43 tty52 tty61
- # 仮想CD-ROMを取り出す(これ大事)
- pi@raspberrypi:~$ eject
- # L-02C接続有無の確認
- pi@raspberrypi:~$ ll /dev/tty [TAB]キーを押す
- tty tty18 tty28 tty38 tty48 tty58 ttyprintk
- tty0 tty19 tty29 tty39 tty49 tty59 ttyUSB0 # 追加
- tty1 tty2 tty3 tty4 tty5 tty6 ttyUSB1 # 追加
- tty10 tty20 tty30 tty40 tty50 tty60 ttyUSB2 # 追加(wvdial.confで使う)
- tty11 tty21 tty31 tty41 tty51 tty61 ttyUSB3 # 追加
- tty12 tty22 tty32 tty42 tty52 tty62
- tty13 tty23 tty33 tty43 tty53 tty63
- tty14 tty24 tty34 tty44 tty54 tty7
- tty15 tty25 tty35 tty45 tty55 tty8
- tty16 tty26 tty36 tty46 tty56 tty9
- tty17 tty27 tty37 tty47 tty57 ttyAMA0
- # wvdialの設定
- pi@raspberrypi:~$ sudo cp -p /etc/wvdial.conf /etc/wvdial.conf.old # コピーを忘れずにね!
- pi@raspberrypi:~$ sudo vi /etc/wvdial.conf
- [Dialer Defaults]
- Init1 = ATH
- Init2 = AT&F
- Init3 = ATZ
- Init4 = ATQ0 V1 E1 S0=0 &C1 &D2
- Init5 = AT+CGDCONT=1,"IP","soracom.io"
- Dial Attempts = 3
- Modem Type = Analog Modem
- Dial Command = ATD
- Stupid Mode = yes
- Baud = 460800
- New PPPD = yes
- Modem = /dev/ttyUSB2 # ここがポイント
- ISDN = 0
- Phone = *99***1#
- APN = soracom.io
- Username = sora
- Password = sora
- Carrier Check = no
- Auto DNS = 1
- Check Def Rpoute = 1
- # インターフェース確認(wlan0がある)
- pi@raspberrypi:~$ ip a | grep wlan0
- 3: wlan0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP group default qlen 1000
- inet 192.168.xx.x/24 brd 192.168.xxx.255 scope global wlan0
- # ネットワーク経路確認
- pi@raspberrypi:~$ netstat -nr
- Kernel IP routing table
- Destination Gateway Genmask Flags MSS Window irtt Iface
- 0.0.0.0 192.168.xx.x 0.0.0.0 UG 0 0 0 wlan0
- 192.168.xx.x 0.0.0.0 255.255.255.0 U 0 0 0 wlan0
- # wvdialコマンドの実行( & はバックグランドで動かすため)
- pi@raspberrypi:~$ sudo wvdial& # [Enter]キーでコマンド入力が可能
- # インターフェースの確認(ppp0が追加)
- pi@raspberrypi:~$ ip a | grep ppp0
- 6: ppp0: <POINTOPOINT,MULTICAST,NOARP,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UNKNOWN group default qlen 3
- inet 10.xxx.xxx.xxx [略] scope global ppp0
- # ルーティングテーブルの確認
- pi@raspberrypi:~$ netstat -nr
- Kernel IP routing table
- Destination Gateway Genmask Flags MSS Window irtt Iface
- 0.0.0.0 192.168.xx.x 0.0.0.0 UG 0 0 0 wlan0
- 10.xxx.xxx.xxx 0.0.0.0 255.255.255.255 UH 0 0 0 ppp0 # 追加!
- 192.168.xx.x 0.0.0.0 255.255.255.0 U 0 0 0 wlan0
- # 経路確認
- pi@raspberrypi:~$ traceroute google.com
- traceroute to google.com (216.58.197.206), 30 hops max, 60 byte packets
- 1 192.168.xx.x (192.168.xx.x) 4.395 ms 4.564 ms 4.520 ms # wlan0経路で通信!
- # デフォルトゲートウェイを ppp0 へ変更
- pi@raspberrypi:~$ sudo route add default dev ppp0
- # ルーティングテーブルの確認
- pi@raspberrypi:~$ netstat -nr
- Kernel IP routing table
- Destination Gateway Genmask Flags MSS Window irtt Iface
- 0.0.0.0 0.0.0.0 0.0.0.0 U 0 0 0 ppp0 # 追加!
- 0.0.0.0 192.168.xx.x 0.0.0.0 UG 0 0 0 wlan0
- 10.xxx.xxx.xxx 0.0.0.0 255.255.255.255 UH 0 0 0 ppp0
- 192.168.xx.x 0.0.0.0 255.255.255.0 U 0 0 0 wlan0
- # 経路確認
- pi@raspberrypi:~$ traceroute google.com
- traceroute to google.com (216.58.196.238), 30 hops max, 60 byte packets
- 1 ec2-xxx-xxx-xxx-xxx.ap-northeast-1.compute.amazonaws.com (xxx.xxx.xxx.xxx) 47.839 ms [略] # ppp0経路で通信!
- pi@raspberrypi:~$ fg # フォアグランドにする。
- sudo wvdial
- [CTRL]+[C]キーを押すと接続停止
- # インターフェースの確認(ppp0がないことを確認)
- pi@raspberrypi:~$ ip a | grep ppp0
- pi@raspberrypi:~$
- # ラズパイの停止
- pi@raspberrypi:~$ sudo shutdown -h now
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement