最後是用pppd完成3G tether
目前tether皆用命令模式,希望能有人告知如何用UI方式.....
實現3G modem,要以下著手:
1. Kernel支持 ppp協議及usb serial converter
2. User Mode支持Usb_modeswitch配置命令
3. libusb提供usb_modeswitch一套系統API(新版usb-modeswitch內含libusb函式庫)
4. User Mode支持撥接命令(pppd+chat或wvdial目前仍有問題)
1.重新編譯kernel
a.把 iptables/netfilter選項開啟,並停用bridge
-> Networking support
-> Networking options
-> Network packet filtering framework(Netfilter)
-> Network packet filtering debugging
-> Advaned netfilter configuration
Core Netfilter Configuration
-> Netfilter NFQUEUE over NFNETLINK interface
-> Netfilter connection tracking support
-> Netbios name service protocal support(new)
-> Netfilter Xtables support (required for ip_tables)
-> multiport Multiple port match support
-> owner match support
-> state match support
IP: Netfilter Configuration
-> IPv4 connection tracking support (require for NAT)
-> proc/sysctl compatibility with old connection tracking
-> IP tables support (required for filtering/masq/NAT)
-> Packet filtering
-> REJECT target support
-> Full NAT
-> MASQUERADE target support
-> REDIRECT target support
b.支持 ppp協議及usb serial converter
-> Device Drivers---→(USB Converter)
USB support---→
<*>USB SerialConverter support--→
[*]USB Generic Serial Driver
<*>USB driver for GSM and CDMA modems’
-> Device Drivers--→(pppd)
Network device support---→
<*> PPP (point-to-point protocol) support
[*] PPP multilink support (EXPERIMENTAL)
<*> PPP support for async serial ports
<*> PPP support for sync tty ports
<*> PPP Deflate compression
<*> PPP BSD-Compress compression
2.編譯ar6000.ko
3.hostapd及dnsmasq
4.撰寫/data/misc/wifi/hostapd.conf 、 /etc/resolv.conf
/data/misc/wifi/hostapd.conf
interface=wlan0
ctrl_interface=wlan0
ssid=AR6003AP
channel=1
max_num_sta=8
beacon_int=100
dtim_period=1
#hw_mode=g
#bridge=br0
#driver=nl80211
#dtim_period=1
#rts_threshold=2347
#fragm_threshold=2346
#macaddr_acl=0
#auth_algs=3
#ieee80211n=0
#ignore_broadcast_ssid=0
wpa=2
wpa_passphrase=12345678
wpa_key_mgmt=WPA-PSK
wpa_pairwise=TKIP CCMP
/etc/resolv.conf
#nameserver 8.8.8.8
#nameserver 4.4.4.4
nameserver 218.30.19.50
nameserver 61.134.1.5
5.撰寫/etc/ppp/peer/wcdma、wcdma-chat-connect及wcdma-chat-disconnect
/etc/ppp/peer/wcdma
#/etc/ppp/peers/cdma
# This is pppd script for China liantong
# Usage: root>pppd call cdma
hide-password
noauth
connect '/usr/sbin/chat -s -v -f /etc/ppp/peers/wcdma-chat-connect'
disconnect '/usr/sbin/chat -s -v -f /etc/ppp/peers/wcdma-chat-disconnect'
debug
/dev/ttyUSB0
#115200
460800
defaultroute
noipdefault
novj
novjccomp
noccp
ipcp-accept-local
ipcp-accept-remote
local
lock
dump
nodetach
user "vibo"
password "vibo"
crtscts
remotename 3gppp
ipparam 3gppp
usepeerdns
debug
/etc/ppp/peer/wcdma-chat-connect
ABORT "BUSY"
ABORT "NO CARRIER"
ABORT "NO DIALTONE"
ABORT "ERROR"
ABORT "NO ANSWER"
TIMEOUT 120
"" AT
OK \rATZ
#OK \rAT+CGDCONT=1,"IP","3gnet",,0,0
OK \rAT+CGDCONT=1,"IP","vibo",,0,0
OK-AT-OK ATDT*99#
CONNECT \d\c
/etc/ppp/peer/wcdma-chat-disconnect
ABORT "ERROR"
ABORT "NO DIALTONE"
SAY "\NSending break to the modem\n"
""\k"
""+++ATH"
SAY "\nGood bay\n"
busybox ifconfig eth0 up
busybox route -n
netcfg eth0 dhcp
insmod /system/wifi/ar6000.ko
busybox ifconfig wlan0 192.168.11.1 up
/system/bin/hostapd -B /data/misc/wifi/hostapd.conf
pppd file /etc/pppd/peer/wcdma
sysctl -w net.ipv4.ip_forward=1
iptables --table nat --flush
iptables --delete-chain
iptables --table nat --delete-chain
iptables --append FORWARD --in-interface wlan0 -o eth0 -j ACCEPT
iptables --table nat --append POSTROUTING --out-interface ppp0 -j MASQUERADE
dnsmasq -z -i wlan0 -F 192.168.11.100,192.168.11.200,12h
[ 此帖被kazaya在2012-03-27 10:32重新编辑 ]