ablog

不器用で落着きのない技術者のメモ

DoCoMo L-05A を Oracle Linux 6.4 on ThinkPad X230 から利用する

WvDial というユーティリティーを使って接続する。*1

設定

  • /etc/wvdial.conf を以下の通り設定する
[Dialer Defaults]
Init2 = ATQ0 V1 E1 S0=0 &C1 &D2
Modem Type = USB Modem
Phone = *99***3#
ISDN = 0
Username = ''
Init1 = ATZ
Password = ''
Modem = /dev/ttyACM0
Baud = 460800
Stupid Mode = yes
Carrier Check = no

Username、Password を使って接続していない場合は上記のように "Username = ''" と "Password = ''" を記述しないと、

--> Configuration does not specify a valid login name.
--> Configuration does not specify a valid password.

と怒られる。

接続する

  • L-05A を PC にさす
  • L-05A を eject する
[root@yazekats-linux etc]# lsusb | grep LG
Bus 003 Device 002: ID 1004:613a LG Electronics, Inc. 
[root@yazekats-linux etc]# eject /dev/sr0
[root@yazekats-linux etc]# lsusb | grep LG            
Bus 003 Device 003: ID 1004:6124 LG Electronics, Inc.
  • vpnagent を停止する*2
[root@yazekats-linux ~]# ps -ef|grep vpn                                        
root      2749     1  0 14:12 ?        00:00:00 /opt/cisco/vpn/bin/vpnagentd    
root      5124  4264  0 14:55 pts/1    00:00:00 grep vpn                        
[root@yazekats-linux ~]# kill 2749                                              
  • PPP接続をする。
[root@yazekats-linux etc]# wvdial

...

-> primary   DNS address xxx.xxx.xxx.xxx
--> pppd: 6
--> secondary DNS address xxx.xxx.xxx.xxx
--> pppd: 6
  • /etc/resolv.conf にエントリを追記する。
nameserver xxx.xxx.xxx.xxx
nameserver xxx.xxx.xxx.xxx

これで繋がった。

後でやること

  • PC に L-05A をさしたら自動で eject するようにする
  • vpnagent の件を自動化する
  • /etc/resolv.conf の書換えを自動化する

参考


追記(2014/02/16):

  • /usr/local/bin/l05.sh
#!/bin/bash
eject /dev/sr0
service vpnagentd_init stop
wvdial

というのを作った。


追記(2014/03/23):
イケてないけど、とりあえずこんな具合にした。

  • /etc/udev/rules.d/10-local.rules
# for FOMA L-05A
KERNEL=="sr0", ATTRS{vendor}=="LGE*", ATTRS{model}=="CD-ROM*", ATTRS{rev}=="1.00", RUN+="/usr/bin/eject /dev/sr0"
  • /usr/local/bin/l05.sh
#!/bin/bash
service vpnagentd_init stop
nohup wvdial >/dev/null &
sleep 3
echo 'nameserver xxx.xxx.xxx.xxx' >> /etc/resolv.conf
echo 'nameserver xxx.xxx.xxx.xxx' >> /etc/resolv.conf
  • 接続時
# l05a.sh
  • 切断時
# pkill wvdial

*1:自分の Oracle Linux 6.4 には最初からインストールされていた

*2:接続できないので /var/log/messeges を見るとコレが邪魔しているようだったので