- 论坛徽章:
- 0
|
---surferwl 2007-03-01
一:实现环境
系统环境:
IBM_R52、 FreeBSD_RELEASE _6.2
网卡类型:
Vtion Vtion-V1806 Wireless
二: 实现步骤
原理不多讲了,是虚拟了一个modem设备。我的机器插入无线网卡后在"/dev"目录多出了"cuad4"设备,各自的接口不同,产生的具体设备名也不一定是一样的,根据实际情况而定。
root@cnbsd~# ping www.baidu.com
PING www.a.shifen.com (202.108.22.43): 56 data bytes
64 bytes from 202.108.22.43: icmp_seq=0 ttl=59 time=0.987 ms
64 bytes from 202.108.22.43: icmp_seq=1 ttl=59 time=1.474 ms
root@cnbsd~# ls /dev/cuad*
cuad0 cuad0.init cuad0.lock cuad4 cuad4.init cuad4.lock
root@cnbsd~# route flush
default 172.18.228.1 done
root@cnbsd~# kldload umodem
root@cnbsd~# ping www.baidu.com
ping: cannot resolve www.baidu.com: Host name lookup failure
root@cnbsd~# ppp cdma
Working in interactive mode
Using interface: tun0
ppp ON cnbsd> dial
ppp ON cnbsd>
Ppp ON cnbsd>
PPp ON cnbsd>
PPP ON cnbsd>
另开一终端:
#ifconifg
...........
...........
...........
tun0: flags=8051<UP,POINTOPOINT,RUNNING,MULTICAST> mtu 1514
inet 220.205.60.209 --> 220.192.0.7 netmask 0xffffffff
Opened by PID 1037
root@cnbsd~# ping www.baidu.com
PING www.a.shifen.com (220.181.38.5): 56 data bytes
64 bytes from 220.181.38.5: icmp_seq=0 ttl=51 time=336.766 ms
64 bytes from 220.181.38.5: icmp_seq=1 ttl=51 time=355.034 ms
--- www.a.shifen.com ping statistics ---
3 packets transmitted, 2 packets received, 33% packet loss
round-trip min/avg/max/stddev = 336.766/345.900/355.034/9.134 ms
root@cnbsd~#
以上tun0后的ip就是CDMA拨号后的ip。
三:后记
说实话吧,实现这个确实琢磨了许久,中间的查询资料的过程相当...........,在中文的帖子里还真没有一篇相关的资料,有的也是linux的,也是通过手机连上的。一来不想用linux,二来一直用freebsd,以上是记这篇笔记的初衷。
其他的网卡实现应该是一样的了,已经在"华为EC321"上搞定,仔细多看"dmesg"信息总能发现你需要的。
附上ppp.conf的内容:
default:
set log Phase Chat LCP IPCP CCP tun command
ident user-ppp VERSION (built COMPILATIONDATE)
set dial "ABORT BUSY ABORT NO\\sCARRIER TIMEOUT 100 \
\"\" AT OK-AT-OK ATE1Q0 OK \\dATDT\\T TIMEOUT 40 CONNECT"
cdma:
set device /dev/cuad4
set speed 115200
enable dns
disable ipv6
set authname "card"
set authkey "card"
set phone "#777"
set login
set redial 1 1
set timeout 0
add! default HISADDR
[ 本帖最后由 cnbsd5 于 2007-3-1 14:20 编辑 ] |
|