pppoe configuration and dns name resolution

Jack jacks.1785 at gmail.com
Sat Oct 20 04:15:09 UTC 2012


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.

I still don' get why FreeBSD is having trouble
connecting via PPP.

I am trying every combinations that might work,
but still no luck.
Any help will be appreciated.
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=""

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"

routerenable="NO"
#defaultrouter="192.168.1.1"

ppp_enable="YES"
ppp_mode="ddial"
ppp_nat="NO"
ppp_profile="adsl"
ppp_adsl_unit="0"


I tried to specify tun0 interface explicitly,
but still no luck.
When I start ppp using:
      service ppp start

It shows tun0 is busy.

----------------------------------------------------------------------------------------------------------------------

## etc/resolv.conf
#Open DNS nameservers:
nameserver 208.67.222.222
nameserver 208.67.220.220


----------------------------------------------------------------------------------------------------------------------

## /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

----------------------------------------------------------------------------------------------------------------------

## 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
fwe0: flags=8802<BROADCAST,SIMPLEX,MULTICAST> metric 0 mtu 1500
        options=8<VLAN_MTU>
        ether 06:e4:0a:1b:50:36
        nd6 options=29<PERFORMNUD,IFDISABLED,AUTO_LINKLOCAL>
        ch 1 dma -1
fwip0: flags=8802<BROADCAST,SIMPLEX,MULTICAST> metric 0 mtu 1500
        lladdr 6.e4.a.0.28.1b.50.36.a.2.ff.fe.0.0.0.0
        nd6 options=29<PERFORMNUD,IFDISABLED,AUTO_LINKLOCAL>
lo0: flags=8049<UP,LOOPBACK,RUNNING,MULTICAST> metric 0 mtu 16384
        options=600003<RXCSUM,TXCSUM,RXCSUM_IPV6,TXCSUM_IPV6>
        inet6 ::1 prefixlen 128
        inet6 fe80::1%lo0 prefixlen 64 scopeid 0x9
        inet 127.0.0.1 netmask 0xff000000
        nd6 options=21<PERFORMNUD,AUTO_LINKLOCAL>
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

----------------------------------------------------------------------------------------------------------------------

## output of ifconfig after I started ppp using
## service ppp start

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
fwe0: flags=8802<BROADCAST,SIMPLEX,MULTICAST> metric 0 mtu 1500
        options=8<VLAN_MTU>
        ether 06:e4:0a:1b:50:36
        nd6 options=29<PERFORMNUD,IFDISABLED,AUTO_LINKLOCAL>
        ch 1 dma -1
fwip0: flags=8802<BROADCAST,SIMPLEX,MULTICAST> metric 0 mtu 1500
        lladdr 6.e4.a.0.28.1b.50.36.a.2.ff.fe.0.0.0.0
        nd6 options=29<PERFORMNUD,IFDISABLED,AUTO_LINKLOCAL>
lo0: flags=8049<UP,LOOPBACK,RUNNING,MULTICAST> metric 0 mtu 16384
        options=600003<RXCSUM,TXCSUM,RXCSUM_IPV6,TXCSUM_IPV6>
        inet6 ::1 prefixlen 128
        inet6 fe80::1%lo0 prefixlen 64 scopeid 0x9
        inet 127.0.0.1 netmask 0xff000000
        nd6 options=21<PERFORMNUD,AUTO_LINKLOCAL>
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

----------------------------------------------------------------------------------------------------------------------

Now it seems to me that there might be some sequence of statements in
/etc/ppp/ppp.conf that works, and others don't

But what is that magic 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.

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.

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 .

In other words, tun0 interface here  should be PPP client, and
PPP server is at ISP side.

Ths fxp0 interface is used for both types of traffic - local LAN
traffic and the PPP traffic.


PC <------------------------------> ADSL modem <--------------> ISP
  fxp0
(LAN DHCP Client)           LAN  DHCP server         doesn't know about
   192.168.1.2                  192.168.1.1                          LAN

  tun0                          transparent to PPP  traffic
PPP client                    ( in bridge mode)                  PPP  Server


So, from ISP's PPP server's perspective, the only thing it sees on
customer side is PPP client ie tun0 interface.
PPP server doesn't know anything about adsl modem in between
and any LAN at customer side.
adsl modem just acts as a PPP traffic forwarder - that's why it is
called a bridge mode of modem.

So, tun0 interface is the interface to which ISP's PPP server will
assign the public IP address.

>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.

But in FreeBSD, if I enable dhcp on fxp0, then
/etc/resolv.conf is created each time I boot in FreeBSD,
so the only nameserver being 192.168.1.1, ie adsl
modem ethernet interface.
Even if I edit it to include nameservers of my ISP or OpenDNS
this file is created each time FreeBSD boots, and these entries
are lost, with only entry being 192.168.1.1

Is this a FreeBSD design/behaviour issue?

Can anyone throw light on the issue I'm facing?
Any possible tricks I might be missing, while configuring PPP
interface?


Regards,
--
Jack


More information about the freebsd-questions mailing list