Connect with 3G UBS modem Huawei E160 and E173 in FreeBSD 10.3-RELEASE.
ISP: Safaricom.com - Kenya
- check if u3g driver is loaded: kldstat
- if is not there do kldload u3g (add to /boot/loader.conf: u3g_load="YES")
If I remember correctly FreeBSD 11 recognize the modem without need to manually load u3g driver.
- create a /etc/ppp/ppp.conf file with this code:
Code:
default:
saf:
set device /dev/cuaU0.0
set timeout 0
set dial "ABORT BUSY ABORT NO\\sCARRIER TIMEOUT 5 \
\"\" \
AT OK-AT-OK \
AT+CPIN="" OK-AT-OK \
ATH OK-AT-OK \
ATE1 OK-AT-OK \
AT+CGDCONT=1,\\\"IP\\\",\\\"web.safaricom.com\\\" OK \
\\dATD*99# TIMEOUT 40 CONNECT"
set authname "SAF"
set authkey "WEB"
set ifaddr 10.0.0.1/0 10.0.0.2/0 255.255.255.255 0.0.0.0
add default HISADDR
That's all: Huawei 3G modems use HiLink, a system by Huawei. There is no need to be initialized by usb_modeswitch.
Ref.: #15328 (NCM Protocol support) - OpenWrt
https://dev.openwrt.org/ticket/15328
Connect and disconnect
like root do
- to connect: /usr/sbin/ppp -ddial saf
- to disconnect: killall -9 ppp
Check new network interfaces with: ifconfig
when ifconfig show the inet you are connected: inet 'your.local.IP.here' --> 10.0.0.2 netmask 0xffffffff
To start modem at boot (without root password) add in /etc/rc.conf
ppp_enable="YES" ppp_mode="ddial" ppp_profile="saf"
About ppp.conf
/dev/cuaU0.0 device number can be different, list: ls -l /dev/cuaU*
Safaricom.com setup
AT+CPIN="" is the card PIN or live blank if PIN authentication is disabled
APN=web.safaricom.com (can be different)
dial number: *99#
APN_USER=SAF
APN_PASS=WEB
Airtel.com setup
AT+CPIN="" is the card PIN or live blank if PIN authentication is disabled
APN=ke.centel.com
dial number: *99#
Live blank APN_USER=
(set authname "")
Live blank APN_PASS=
(set authkey "")
- Do not use options: more options more difficult to connect
- ppp warning are not so important (Warning: Add! route failed: ff02::: ...)
- Create and read the ppp log file: /var/log/ppp.log
About the hardware
- Huawei 3G USB modems have different chip and setup (set device /dev/cuaU0.1).
- Some USB ports don't have enough power for the modem.
- Sometime the connection can fail only because the modem is not in a good position.
- Different Operative Systems manage the same hardware in different ways.
Reference
FreeBSD Docs: Handbook Chapter 26. PPP
FAQ FreeBSD: Chapter 14. PPP
man ppp