Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 20 Oct 2012 08:09:05 +0200
From:      Polytropon <freebsd@edvax.de>
To:        Jack <jacks.1785@gmail.com>
Cc:        freebsd-questions@freebsd.org
Subject:   Re: pppoe configuration and dns name resolution
Message-ID:  <20121020080905.27440256.freebsd@edvax.de>
In-Reply-To: <CACmXQA3waRyeTNKwcMz8g4QQVp9ZPfwjb81tU5PKqFpn=A9iXA@mail.gmail.com>
References:  <CACmXQA2z_x1tpm0mm=41OzZa6MKVbn_en2+rn2t6q5miZtV4HQ@mail.gmail.com> <CACmXQA3waRyeTNKwcMz8g4QQVp9ZPfwjb81tU5PKqFpn=A9iXA@mail.gmail.com>

Next in thread | Previous in thread | Raw E-Mail | Index | Archive | Help
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 <myusername>
>  set authkey <mypassword>	
>  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 <myusername>
	set authkey <mypassword>
	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<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 1500
> 	options=2009<RXCSUM,VLAN_MTU,WOL_MAGIC>
> 	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<PERFORMNUD,IFDISABLED,AUTO_LINKLOCAL>
> 	media: Ethernet autoselect (100baseTX <full-duplex>)
> 	status: active

Looks good so far - connected to the modem.




> tun0: flags=8051<UP,POINTOPOINT,RUNNING,MULTICAST> metric 0 mtu 1500
> 	options=80000<LINKSTATE>
> 	nd6 options=29<PERFORMNUD,IFDISABLED,AUTO_LINKLOCAL>
> 	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<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 1500
> 	options=2009<RXCSUM,VLAN_MTU,WOL_MAGIC>
> 	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<PERFORMNUD,IFDISABLED,AUTO_LINKLOCAL>
> 	media: Ethernet autoselect (100baseTX <full-duplex>)
> 	status: active

Again, looks correct.




> tun0: flags=8051<UP,POINTOPOINT,RUNNING,MULTICAST> metric 0 mtu 1500
> 	options=80000<LINKSTATE>
> 	nd6 options=29<PERFORMNUD,IFDISABLED,AUTO_LINKLOCAL>
> 	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, ...



Want to link to this message? Use this URL: <http://docs.FreeBSD.org/cgi/mid.cgi?20121020080905.27440256.freebsd>