Contributed by sean on from the AT&F1 ATDT8675309 dept.
Sometimes we need to use a modem or some other serial device connected to another computer. And occasionally, we have access to the device itself. So, here is an example of how it can be accomplished.
To do this we need my netfwd utility (http://www.bsdua.org/netfwd.html). Using netfwd we can easily use a modem connected to another BSD computer.
Suppose that we have two computers, one with physical modem and another computer needs to use it.
Computer with modem
In this example I use a Nokia 6230i phone for connecting to the Internet. I use DKU-2 cable to connect the phone to the computer's USB port. The /dev/cuaU0 device node will be created as soon as I connect phone to the computer. Now, use netfwd to accept incoming connections on port 5555 and redirect all traffic to serial device /dev/cuaU0.# netfwd -d -v tcp 5555 tty /dev/cuaU0 115200,8,N,1,H
On this computer, I use ppp(8) to connect to the Internet. Pay attention to the device parameter in the following configuration file (some parameters are specific to my phone and mobile operator, MTS in this example).mobile: set device remote_computer:5555/tcp set dial "ABORT ERROR ABORT BUSY ABORT NO\\sCARRIER TIMEOUT 5 \ \"\" ATZ OK-ATZ-OK AT+CGDCONT=1,\\\"IP\\\",\\\"hyper.net\\\" \ OK \\dATD\\T TIMEOUT 40 CONNECT" set phone "*99#" set speed 115200 set login set timeout 0 set ifaddr 10.0.0.1/0 10.0.0.2/0 255.255.255.0 0.0.0.0 add default HISADDR enable dns
Now, type the following in shell...# ppp -ddial mobile
and you will get your Internet connection. It's simple as UNIX should be :)
NOTE: Alexey's utility is not in the ports tree as of yet so if you have the knowledge and a few moments to spare why not submit it as a new port?
(Comments are closed)