From owner-freebsd-questions@FreeBSD.ORG Sun Oct 21 11:42:00 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 A3F035F5 for ; Sun, 21 Oct 2012 11:42:00 +0000 (UTC) (envelope-from jacks.1785@gmail.com) Received: from mail-ia0-f182.google.com (mail-ia0-f182.google.com [209.85.210.182]) by mx1.freebsd.org (Postfix) with ESMTP id 65CB28FC0A for ; Sun, 21 Oct 2012 11:42:00 +0000 (UTC) Received: by mail-ia0-f182.google.com with SMTP id k10so1871634iag.13 for ; Sun, 21 Oct 2012 04:41:59 -0700 (PDT) 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 :content-type; bh=d3Zrtpo3V6Sg4qM8foc++XcgMhE0yYHplGNGPUcVS28=; b=ZCOgS9n9SqrzihjGE2sHupKU/RmG8CmoLy0xZEed44RA4qSMjMOPs9agFMOL0n7b0U 1nOFndpmTexinoKf+7Qo7yIroWlNQzmvK3v2iFGSAgPZVUuhk2mDKw39g6goDFdmbBlp KIVk3PBCEpDF3RqGdDoAj15rM6XIIvYtqUU3aBcvPnJEbiSUH2VOyw3wJuVPhJzCtuv3 uGwbWZqLRewQted+6qzh4hIVs4p4XDvmS6xUkShYPWLAt9q5PAlBK2lWEuh1wvZ9mkYT ey0m42/4WOinG+O38EemrV5nBayCL63cgNtTV6jDbBsuBE76m4g7z6upVuWVTtDxOHtY P8Rg== MIME-Version: 1.0 Received: by 10.50.237.70 with SMTP id va6mr13369244igc.8.1350819719784; Sun, 21 Oct 2012 04:41:59 -0700 (PDT) Received: by 10.64.11.166 with HTTP; Sun, 21 Oct 2012 04:41:59 -0700 (PDT) In-Reply-To: <20121020080905.27440256.freebsd@edvax.de> References: <20121020080905.27440256.freebsd@edvax.de> Date: Sun, 21 Oct 2012 17:11:59 +0530 Message-ID: Subject: Re: pppoe configuration and dns name resolution From: Jack To: freebsd-questions@freebsd.org Content-Type: text/plain; charset=ISO-8859-1 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: Sun, 21 Oct 2012 11:42:00 -0000 Hi This time I configured as simple as possible with minimal settings, and voila things worked. I successfully connected to internet in both cases - DHCP server disabled in adsl modem, and DHCP server enabled in adsl modem. Thanks all of you guys for helping. :) Here are config files: ## /etc/rc.config hostname="jacks_lappy" ifconfig_fxp0="DHCP" # The below line is to be used if DHCP server on adsl # modem is disabled. #ifconfig_fxp0="inet 192.168.1.4 netmask 255.255.255.0" # This is assigned to telnet to adsl modem and configure it, # if you don't wanna communicate with modem, remove # this line. It doesn't affect ppp connectivity, in any way - # I tried removing it and got connected successfully. sshd_enable="YES" moused_enable="YES" powerd_enable="YES" # Set dumpdev to "AUTO" to enable crash dumps, "NO" to disable dumpdev="AUTO" hald_enable="YES" dbus_enable="YES" ----------------------------------------------- ## /etc/ppp/ppp.conf: default: set log Phase tun command adsl: set device PPPoE:fxp0 #MRU is optional too, you can remove it # w/o affecting ppp connectivity. set mru 1492 #set mtu 1492 # This was the cause of failure. # See man ppp for more info. # If MTU is set, ppp will not accept MRU values less than MTU. # e.g. MTU = 1492. Now if your ISP has MTU = 1460(my case), then # ppp on your PC, will not connect to ppp server at your ISP side. # So DO NOT set MTU explicitly. set authname set authkey set dial set login add default HISADDR enable dns # a must, if DHCP server is enabled in adsl modem # and if you don't wanna edit /etc/resolv.conf # each time before connecting tp ISP's ppp server. #Now you don't need to touch /etc/resolv.conf ----------------------------------------------------------------- My /etc/resolv.conf is updated each time I start ppp, so I didn't needed to edit it. I simply started ppp via ppp -ddial adsl I also didn't start ppp at bootup, as it requires that your adsl modem must be powered on before FreeBSD begins booting, which is not the usual case for me. Also, as soon as I started ppp, an ip address is assigned to tun0 interface by ISP, while fxp0 was assigned its ip address via DHCP server enabled in adsl modem, even before I attempted to dial ppp. That is expected. I also tested this configuration with DHCP server disabled in adsl modem and it too worked successfully, except I need to chnage the line fxp0="DHCP" to manually assigned ip address one, no other change was needed. The problem might be I was I trying to explcitly set MTU to be 1492, which ppp takes as minimum value - ie no MTU value less than 1492 is agreed upon by user ppp. My ISP's MTU was 1460, and since 1460 < 1492, so ppp was not agreeing upon MTU value and no connection was made. Thanks again all of you guys for sorting this out. :) Mean while I created a script to start and stop ppp service for a profile. This script is specifically written for csh/tcsh shell - the default one for FreeBSD, so some changes need to be made if it is to be run in other shells. Just go to c shell and type pppdo where 'profilename' is the desired profilename defined in etc/ppp/ppp.conf, and either you 'start' ppp or 'stop' ppp. ------------------------------------------------------------------------------------ Here goes the script: pppdo.sh #!/bin/csh if ( $#argv != 2 ) then echo "Usage: $0 " exit endif switch ($2) case start: /usr/sbin/ppp -ddial $1 ; breaksw case stop: killall -INT ppp killall -HUP ppp ; breaksw default: echo "$0 : Invalid Cmd" ; breaksw endsw --------------------------------------------------------------------------------------------- NOTE: before executing this script make sure it is executable If not, type this at shell: chmod +x ./pppdo.sh After executing this script try pinging to a remote site to confirm connectivity, e.g. type this at shell: ping -c5 freebsd.org If you get 0.0% packet loss, then you made it! So, the only files that require modifications are /etc/ppp/ppp.conf and /etc/rc.conf No other file need to be modified to use user ppp, no matter whether DHCP server on your adsl modem is enabled or disabled, it doesn't matter - just use the configuration mention above. Then use the script as: ./pppdo adsl start to start the ppp profile named "adsl"(tun0 interface is created), and use ./pppdo adsl stop to stop the ppp. This will destroy the tun0 interface too. PS: The user account from which this script is to be run, must be a member of "network" group too, though "network" group need not to be the user's login group. This is the requirement of user ppp itself, and not of this script. Regards -- Jack