From owner-freebsd-questions@FreeBSD.ORG Wed Nov 28 16:05:32 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 D9FA1699 for ; Wed, 28 Nov 2012 16:05:31 +0000 (UTC) (envelope-from freebsd@edvax.de) Received: from mx01.qsc.de (mx01.qsc.de [213.148.129.14]) by mx1.freebsd.org (Postfix) with ESMTP id 7AC088FC18 for ; Wed, 28 Nov 2012 16:05:31 +0000 (UTC) Received: from r56.edvax.de (port-92-195-51-39.dynamic.qsc.de [92.195.51.39]) by mx01.qsc.de (Postfix) with ESMTP id 15D773CB99; Wed, 28 Nov 2012 17:05:23 +0100 (CET) Received: from r56.edvax.de (localhost [127.0.0.1]) by r56.edvax.de (8.14.5/8.14.5) with SMTP id qASG5PO5002854; Wed, 28 Nov 2012 17:05:25 +0100 (CET) (envelope-from freebsd@edvax.de) Date: Wed, 28 Nov 2012 17:05:25 +0100 From: Polytropon To: s m Subject: Re: set connection to a modem Message-Id: <20121128170525.c3fb92e8.freebsd@edvax.de> In-Reply-To: References: Organization: EDVAX X-Mailer: Sylpheed 3.1.1 (GTK+ 2.24.5; i386-portbld-freebsd8.2) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Cc: freebsd-questions@freebsd.org X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list Reply-To: Polytropon List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 28 Nov 2012 16:05:32 -0000 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, ...