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,HAnother computer
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 dnsNow, type the following in shell...
# ppp -ddial mobileand 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)
By corey (208.191.177.19) on
That's not to say Alexey's utility shouldn't be ported, though. Choice is good.
Comments
By Alexey Vatchenko (av) av@bsdua.org on http://www.bsdua.org
I didn't know about socat.
Anyway, my goal is to create BSD specific (kqueue/kevent), BSD licensed, no forking, easy-to-use program with a clear code and clear design. It doesn't mean that socat is opposite :)
I'm going to create ``port''. I never did this before, so i need some time :) Anyway, if someone wants to help, it would be cool!
By Sacha Ligthert (213.46.69.133) sacha@ligthert.net on
Comments
By Daniel Hartmeier (dhartmei) on janitor
They did read and type in the captcha...
By Peter (65.43.81.8) on pbw.us