From owner-freebsd-questions@FreeBSD.ORG Thu Nov 29 06:38:17 2012 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id F2DFC2D9 for ; Thu, 29 Nov 2012 06:38:16 +0000 (UTC) (envelope-from sam.gh1986@gmail.com) Received: from mail-vc0-f182.google.com (mail-vc0-f182.google.com [209.85.220.182]) by mx1.freebsd.org (Postfix) with ESMTP id 8EF038FC13 for ; Thu, 29 Nov 2012 06:38:16 +0000 (UTC) Received: by mail-vc0-f182.google.com with SMTP id fo13so19508024vcb.13 for ; Wed, 28 Nov 2012 22:38:15 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=gwtwWFan+1nftIMO+5RbbKng6yFbc+iUwUGG3m0IJM0=; b=fO+ZzrkYaFyGbvdKuiM1ylavgRtWQjhprta/tsCY3CZz8kFZ4aEZW2QQOklOsfwEOG qbgHTpnYYXX7Mfi2Nl6PGKP/X73CAKQlrD2d34gQUAr+o9NuoX9AXSdvcdPIFfVOdXIq uGpK2Zv0FI8BbcoDH1HG1DbZWOny7fW8EwU6EEjZOb3vGioAV9UtQxLoU8eO8PAOQNU4 hjBCc7mCf2EudKD9Ju3xld+ZFTvs+7Ogz6aS1FSUonujRtsEHutwCu1GmdwuS+sUIxWF P1ToV+lz+ps5TbBDEKYI/yG7TINvUfqzgcf3VRaRTZB98T2YfNCcPFMBC9CkYuxYXKmk NHcQ== MIME-Version: 1.0 Received: by 10.52.65.147 with SMTP id x19mr27223142vds.113.1354171095515; Wed, 28 Nov 2012 22:38:15 -0800 (PST) Received: by 10.58.196.230 with HTTP; Wed, 28 Nov 2012 22:38:15 -0800 (PST) In-Reply-To: <20121128170525.c3fb92e8.freebsd@edvax.de> References: <20121128170525.c3fb92e8.freebsd@edvax.de> Date: Thu, 29 Nov 2012 10:08:15 +0330 Message-ID: Subject: Re: set connection to a modem From: s m To: Polytropon Content-Type: text/plain; charset=ISO-8859-1 X-Content-Filtered-By: Mailman/MimeDel 2.1.14 Cc: freebsd-questions@freebsd.org X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 29 Nov 2012 06:38:17 -0000 thanks guys for your replies, now i understand two types of connections are available by modem, dial-in and dial-out. honestly, i should do it for my boss and don't know what he should want exactly to do but i am sure that he has an external serial modem and wants to config it by AT commands via a freebsd system; therefore i think our connection is dial-out. now which files i should edit? just ppp.conf? and because our modem supports specific speed and flow control, is it necessary to set these parameters in my freebsd? and if yes, how i can do that? please help me to do that thanks On Wed, Nov 28, 2012 at 7:35 PM, Polytropon wrote: > On Wed, 28 Nov 2012 13:44:18 +0330, s m wrote: > > hello guys, > > > > i want to connect my freebsd system to modem and configure it via my > > freebsd. > > For doing _what_ exactly? I ask because depending on your > goal there might be different approaches neccessary: > > a) dial out to connect to the Internet > b) dial out to dial in to something else (e. g. shell access) > c) dial out to send a fax > d) dial out to make annoying phone calls :-) > e) dial in so people can dial your system and log in > f) dial in so people can send you fax > g) dial in so you can control something using DTMF > ....... > > There are many possibilities, each requiring a different > thing to do on FreeBSD (because they are obviously different(. > > And of course: Are you talking about a real modem (external > serial modem), some modem card (often dysfunctional "WinModem"), > or a USB modem? Brand and model? > > > > > i thought that i should change /etc/ttys file to set speed and > > other configuration. > > Wouldn't you better do this with ppp.conf? Just assuming you > want to dial _out_. > > > > > in order to check if i am right or not, i comment ttyu > > line in ttys file and expect the modem got disconnected but the modem > still > > works and can access to it. > > The /etc/ttys file doesn't restrict you in controlling the > modem from your host system. > > > > > i googled and found that there are three files in /etc that we can edit > > them to configure our devices: /etc/ttys, /etc/gettytab and > > /etc/rc.d/serial.sh. moreover we can edit init file for each device in > /dev > > to set default speed and other configuration by stty command. > > Also depends on _what_ you are going to do. > > > > > now i am confused and don't know which file i should edit to set speed > and > > flow control and other setting to have a connection to my modem. i mean > > from which file i can configure my connection? i know it's too easy but > > please clear it for me. > > Really, I assume you're talking about dialing out with a serial > modem in order to connect to the Internet (or some other system), > and then be "networked" with it. > > In that case you would add an entry to /etc/ppp/ppp.conf. Allow > me to provide an example that I've been using on FreeBSD 4 and 5: > > # PPP Configuration File > # See /usr/share/examples/ppp/ for some examples > # $FreeBSD: src/etc/ppp/ppp.conf,v 1.8 2001/06/21 15:42:26 brian Exp $ > > default: > set log Phase Chat LCP IPCP CCP tun command > ident user-ppp VERSION (built COMPILATIONDATE) > set device /dev/cuaa0 > set speed 115200 > set dial "ABORT BUSY ABORT NO\\sCARRIER TIMEOUT 5 \"\" AT OK-AT-OK > ATE1Q0 OK \\dATDT\\T TIMEOUT 40 CONNECT" > set ifaddr 10.0.0.1/0 10.0.0.2/0 > set timeout 180 > enable dns > > papchap: > # edit the next three lines and replace the items in caps with > # the values which have been assigned by your ISP. > set phone PHONE_NUM > set authname USERNAME > set authkey PASSWORD > set ifaddr 10.0.0.1/0 10.0.0.2/0 255.255.255.0 0.0.0.0 > add default HISADDR > > mymodem: > set phone 01234567890 > set authname myname > set authkey mypass > add default HISADDR > > The example name I've chosen here is "mymodem". Change it > to something meaningful. :-) > > The essential authorisation data here is the phone number > of 01234567890, the username 'myname' and the password 'mypass' > > Note that today it may be required to change the device name! > I haven't tried to do anything with a modem on current FreeBSD, > so I can't be more specific, sorry. > > The device name /dev/cuaa0 will probably need a change. And > then "set speed 115200" sets the speed you need. > > If you've done everything properly, you would do something like > > # ppp mymodem > ppp> dial > > Then the modem should dial. With "close" you close the connection. > There are options for /etc/rc.conf (the ppp_* variables) that > allow you to automate things, like "dial on demand". > > > > > > In contradiction, in /etc/ttys something like > > ttyd0 "/usr/libexec/getty std.9600" dialup on secure > > would enable you a serial "console access" (e. g. to connect a > serial terminal to) at a speed of 9k6 (e. g. a DEC vt100). When > connected via serial cable, you would receive a login prompt. > > Again, note that ttyd0 might not be valid here. > > > > > > -- > Polytropon > Magdeburg, Germany > Happy FreeBSD user since 4.0 > Andra moi ennepe, Mousa, ... >