From owner-freebsd-questions@FreeBSD.ORG Sat Oct 20 06:09:08 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 8382BA7D for ; Sat, 20 Oct 2012 06:09:08 +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 1FE638FC0A for ; Sat, 20 Oct 2012 06:09:07 +0000 (UTC) Received: from r56.edvax.de (port-92-195-110-131.dynamic.qsc.de [92.195.110.131]) by mx01.qsc.de (Postfix) with ESMTP id 119453CD81; Sat, 20 Oct 2012 08:09:06 +0200 (CEST) Received: from r56.edvax.de (localhost [127.0.0.1]) by r56.edvax.de (8.14.5/8.14.5) with SMTP id q9K695oH001972; Sat, 20 Oct 2012 08:09:05 +0200 (CEST) (envelope-from freebsd@edvax.de) Date: Sat, 20 Oct 2012 08:09:05 +0200 From: Polytropon To: Jack Subject: Re: pppoe configuration and dns name resolution Message-Id: <20121020080905.27440256.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: Sat, 20 Oct 2012 06:09:08 -0000 On Sat, 20 Oct 2012 09:42:31 +0530, Jack wrote: > Hi again, > > This time I disabled DHCP on my fxp0 interface and > in my adsl modem too. > But the problem still exists. > > This time I tried both approaches: > assigned an IP address explicitly to fxp0, and > then no explicit assignment to fxp0. That should be the easiest test setting. > I still don' get why FreeBSD is having trouble > connecting via PPP. Seems to be a specific problem. There is no general problem with PPPoE on FreeBSD. > I am trying every combinations that might work, > but still no luck. > Any help will be appreciated. Try to limit "variables" as much as possible. Control one "thing" per time. > I'm posting my config files. The statements in comments > are those that I already tried enabling them. > > > ## /etc/rc.conf > hostname="jacks_lappy" > #ifconfig_fxp0="DHCP" > #ifconfig_tun0="" > ifconfig_fxp0="inet 192.168.1.4 netmask 255.255.255.0" > #ifconfig_fxp0="" Is this IP inside your network? In my old setting, I had defined the IP for the NIC connected to the modem as 192.168.0.1, but my own network (and therefor also the 2nd NIC in the machine) in 192.168.1.* - I don't know if the first could have been omitted, just doing ="up" for the NIC connected to the modem. > 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" No problem here, not related. > routerenable="NO" This option does not exist. See /etc/defaults/rc.conf for a list of them. I haven't used that option in the working setup. > #defaultrouter="192.168.1.1" Correct - I also did not define a default router. > ppp_enable="YES" > ppp_mode="ddial" > ppp_nat="NO" > ppp_profile="adsl" > ppp_adsl_unit="0" I've also not used the last parameter. The tun0 interface would have been generated automatically. Everything implies that the _kernel_ has all the neccessary functionality enabled (tun interface, PPPoE related netgraph modules and NIC support). > I tried to specify tun0 interface explicitly, > but still no luck. No need to do so. > When I start ppp using: > service ppp start > > It shows tun0 is busy. Which is correct. > ## etc/resolv.conf > #Open DNS nameservers: > nameserver 208.67.222.222 > nameserver 208.67.220.220 Those are OpenDNS resolvers. I've been using two provided by my ISP, and also ran named myself later on. > ## /etc/ppp/ppp.conf > > default: > set log Phase chat lcp ipcp ccp tun command lqm > set ifaddr 10.0.0.1/0 10.0.0.2/0 0.0.0.0 0.0.0.0 > # set ifaddr 10.0.0.1/0 10.0.0.2/0 255.255.255.255 0.0.0.0 > nat enable no > > adsl: > set device PPPoE:fxp0 > #set device PPPoE:tun0 > set mru 1492 > set mtu 1492 > set ctsrts off > set speed sync > set dial > > enable lqr > > set login > set authname > set authkey > set timeout 120 > set redial 0 0 > > add default HISADDR > #enable dns Why not try a minimal configuration? myispname: set device PPPoE:fxp0 set authname set authkey set dial set login add default HISADDR That should be everything which is needed. For better diagnostics, add your custom options (like lpr or redial) later on. As I said, all my examples and suggestions are taken from a working example, different OS versions, different physical modems. ---------------------------------------------------------------------------------------------------------------------- > > ## output of ifconfig just after boot: > > fxp0: flags=8843 metric 0 mtu 1500 > options=2009 > ether 00:16:d3:0c:42:22 > inet 192.168.1.4 netmask 0xffffff00 broadcast 192.168.1.255 > inet6 fe80::216:d3ff:fe0c:4222%fxp0 prefixlen 64 scopeid 0x6 > nd6 options=29 > media: Ethernet autoselect (100baseTX ) > status: active Looks good so far - connected to the modem. > tun0: flags=8051 metric 0 mtu 1500 > options=80000 > nd6 options=29 > Opened by PID 1231 Does not look good - no IP assigned. > ## output of ifconfig after I started ppp using > ## service ppp start The ppp should have been started automatically... > fxp0: flags=8843 metric 0 mtu 1500 > options=2009 > ether 00:16:d3:0c:42:22 > inet 192.168.1.4 netmask 0xffffff00 broadcast 192.168.1.255 > inet6 fe80::216:d3ff:fe0c:4222%fxp0 prefixlen 64 scopeid 0x6 > nd6 options=29 > media: Ethernet autoselect (100baseTX ) > status: active Again, looks correct. > tun0: flags=8051 metric 0 mtu 1500 > options=80000 > nd6 options=29 > Opened by PID 1231 And again no IP here. > Now it seems to me that there might be some sequence of statements in > /etc/ppp/ppp.conf that works, and others don't That's possible. Limit the statements first, starting from the ppp.conf file provided by the system. Just add the few lines neccessary to have ppp create the connection. > But what is that magic sequence? I don't know, I just can tell you a working sequence. :-) > PS: In windows there is no problem connecting via ppp, even if > I use DHCP server enabled on my adsl modem, and modem is > in bridge mode. In "Windows", there's also no way for you to find out what actually happens, so this information is not of very much help. (I'm almost sure you could use Wireshark to listen to the "conversation" the PC and the modem are having, to obtain more details...) > So, there must be some way in FreeBSD too, that works > regardless of whether ip address of fxp0(the ethernet interface > to which adsl modem connects to PC), is assigned via > a DHCP server on modem or manually. Definitely. The easiest way is to first limit "variables" in this setting, so let the modem be a modem, _not_ a router, DHCP server, NAT device or anything else. (This is a statement from my own experience with a modem which was nothing more or less than a modem.) > I understand that if DHCP is enabled on adsl modem, and > fxp0 is assigned the ip address via this DHCP, then the PPP > server of ISP to which we are trying to connect, will also assign > a public IP address to the PPP client, which in case of FreeBSD > is tun0 interface rather than fxp0 . I assume that if you obtain connection data via DHCP, you'll also get assigned other data like nameservers. That means you will not have to deal with PPPoE at all because the modem does the "connection work". This is an assumption, I don't know your particular modem to make a better guess. :-) > So, tun0 interface is the interface to which ISP's PPP server will > assign the public IP address. I have to admit that I have limited experience with involving DHCP in the PPPoE process. I know several modems that do the "connection work" on their own and have the user _not_ deal with PPPoE details on their side - everything will be done in IP (here: DHCP), providing all required connection details. > From my understanding it shoud not matter whether fxp0 is > assigned the ip address via DHCP server on local lan or via > manually - at least this concept works on windows. I also thing this is not required, as my working example (!) shows that the NIC has had an IP address, but in a different network. > Can anyone throw light on the issue I'm facing? > Any possible tricks I might be missing, while configuring PPP > interface? Do things as simple as possible first. For the examples, see my initial message again. -- Polytropon Magdeburg, Germany Happy FreeBSD user since 4.0 Andra moi ennepe, Mousa, ...