Discussion:
PPPoE connection using only the PPP package
Angel Tsankov
2006-06-04 18:30:25 UTC
Permalink
I managed to setup a connection using RP-PPPoE after enabling PPP in the kernel and installing RP-PPPoE, WvStreams, WvDial and
OpenSSL. However, I'd rather not install all 4 packages when a single one would do. So I read the instruction on
http://wiki.linuxfromscratch.org/blfs/wiki/PPP
and the README.pppoe file in the PPP package. Then I tried to setup a PPPoE connection (using only PPP) by ensuring the contents of
some configuration files read as follows:

/etc/ppp/options:
lock
plugin rp-pppoe.so

/etc/ppp/pap-secrets, /etc/ppp/chap-secrets:
"<my username>" * "<my password>"

/etc/ppp/pppoe-server-options:
require-pap
login
lcp-echo-interval 10
lcp-echo-failure 2

Besides, I setup /etc/ppp/pppoe.conf according to the instructions I received from my ISP. In fact, I just copied the file when
PPPoE was setup with RP-PPPoE. There was no /etc/resolv.conf in the case with RP-PPPoE, so I decided not to create one in the case
with PPP only.

Then I executed
pppd eth0
which produced:
Plugin rp-pppoe.so loaded.
RP-PPPoE plugin version 3.3 compiled against pppd 2.4.3

Then I ping'ed an Internet host by IP address and got:
ping: sendto: Network is unreachable

Can someone help me setup a PPPoE connection using only the PPP package?
Andrew Benton
2006-06-04 19:52:12 UTC
Permalink
Angel Tsankov wrote:
> I managed to setup a connection using RP-PPPoE after enabling PPP in the
> kernel and installing RP-PPPoE, WvStreams, WvDial and OpenSSL. However,
> I'd rather not install all 4 packages when a single one would do.

OpenSSL is useful for other things to link to, but I agree about the others.

> /etc/ppp/pppoe-server-options:

Does pppd read /etc/ppp/pppoe-server-options?

> require-pap
> login
> lcp-echo-interval 10
> lcp-echo-failure 2

I would normally put these sort of options in a file in /etc/ppp/peers
and then run pppd with the option to call the name of the file. So if
you put the options in /etc/ppp/peers/ISP you would launch pppd with

pppd call ISP

> Besides, I setup /etc/ppp/pppoe.conf according to the instructions I
> received from my ISP.

Yes, but does pppd read /etc/ppp/pppoe.conf? In my experience it reads
the name of the file in /etc/ppp/peers that you point it towards, it
reads /etc/ppp/options, if your ISP uses pap authentication it reads
/etc/ppp/pap-secrets and if your ISP uses chap authentication it reads
/etc/ppp/chap-secrets

> In fact, I just copied the file when PPPoE was
> setup with RP-PPPoE. There was no /etc/resolv.conf in the case with
> RP-PPPoE, so I decided not to create one in the case with PPP only.

If you launch pppd with the option usepeerdns it will create the file
/etc/ppp/resolv.conf
If you want, you can make a symbolic link pointing at it from /etc

ln -s ppp/resolv.conf /etc/resolv.conf

> Then I executed
> pppd eth0
> which produced:
> Plugin rp-pppoe.so loaded.
> RP-PPPoE plugin version 3.3 compiled against pppd 2.4.3

It looks to me like this launches pppd to use the interface /dev/eth0
with just the options in /etc/ppp/options

> Then I ping'ed an Internet host by IP address and got:
> ping: sendto: Network is unreachable
>
> Can someone help me setup a PPPoE connection using only the PPP package?

Read man pppd. And Google. There's tons of stuff out there about
networking issues.

Andy
Alexander E. Patrakov
2006-06-05 11:45:21 UTC
Permalink
Angel Tsankov wrote:
> Then I executed
> pppd eth0
> which produced:
> Plugin rp-pppoe.so loaded.
> RP-PPPoE plugin version 3.3 compiled against pppd 2.4.3
>
> Then I ping'ed an Internet host by IP address and got:
> ping: sendto: Network is unreachable
>
> Can someone help me setup a PPPoE connection using only the PPP package?
>
Yes, sorry for inaccurate instructions in the Wiki. You need to run:

ip link set eth0 up

and only then "pppd eth0" (assuming that everything ele is correct)

--
Alexander E. Patrakov
Angel Tsankov
2006-06-06 18:52:01 UTC
Permalink
>> Then I executed
>> pppd eth0
>> which produced:
>> Plugin rp-pppoe.so loaded.
>> RP-PPPoE plugin version 3.3 compiled against pppd 2.4.3
>>
>> Then I ping'ed an Internet host by IP address and got:
>> ping: sendto: Network is unreachable
>>
>> Can someone help me setup a PPPoE connection using only the PPP package?
>>
> Yes, sorry for inaccurate instructions in the Wiki. You need to run:
>
> ip link set eth0 up
>
> and only then "pppd eth0" (assuming that everything ele is correct)

I built and installed the 2.6.11.12 kernel with support for PPP (plus suboptinos). Then I installed the PPP 2.4.6 package as
described in the BLFS book from 2006-05-31. Then I followed the instructions on http://wiki.linuxfromscratch.org/blfs/wiki/PPP for
establishing a PPPoE connection:

1. created the /etc/ppp/ip-up and the /etc/ppp/peers/pppoe files;
2. populated the /etc/ppp/pap-secrets and the /etc/ppp/chap-secrets files;
3. issued "ip link set eth0 up" (this produced no output on the terminal);
4. issued "pppd call pppoe" and I got:
Plugin rp-pppoe.so loaded.
RP-PPPoE plugin version 3.3 compiled against pppd 2.4.3
Failed to create PPPoE socket: Address family not supported by protocol

Then I removed the updetach option from /etc/ppp/peers/pppoe and reissued "pppd call pppoe". This time I only got:
Plugin rp-pppoe.so loaded.
RP-PPPoE plugin version 3.3 compiled against pppd 2.4.3

The I tried to ping a host on the Internet by IP address and I got:
ping: sendto: Network is unreachable

I also made sure that the ip-up does not get called by adding the following line at the top:
echo 'ip-up called'

Further help on establishing a PPPoE connection using the PPP package only would be greatly appreciated.
Alexander E. Patrakov
2006-06-07 03:06:38 UTC
Permalink
Angel Tsankov wrote:
> 1. created the /etc/ppp/ip-up and the /etc/ppp/peers/pppoe files;
> 2. populated the /etc/ppp/pap-secrets and the /etc/ppp/chap-secrets files;
> 3. issued "ip link set eth0 up" (this produced no output on the terminal);
> 4. issued "pppd call pppoe" and I got:
> Plugin rp-pppoe.so loaded.
> RP-PPPoE plugin version 3.3 compiled against pppd 2.4.3
> Failed to create PPPoE socket: Address family not supported by protocol

That's because you didn't load the "pppoe" kernel module before following the
instructions.

--
Alexander E. Patrakov
Angel Tsankov
2006-06-07 08:33:22 UTC
Permalink
>> 1. created the /etc/ppp/ip-up and the /etc/ppp/peers/pppoe files;
>> 2. populated the /etc/ppp/pap-secrets and the /etc/ppp/chap-secrets files;
>> 3. issued "ip link set eth0 up" (this produced no output on the terminal);
>> 4. issued "pppd call pppoe" and I got:
>> Plugin rp-pppoe.so loaded.
>> RP-PPPoE plugin version 3.3 compiled against pppd 2.4.3
>> Failed to create PPPoE socket: Address family not supported by protocol
>
> That's because you didn't load the "pppoe" kernel module before following the instructions.

Hmm, I had disabled "Loadable module support" prior to rebuilding the kernel. This should mean that the PPPoE module is built into
the kernel and is therefore always loaded, right?
Andrew Benton
2006-06-07 10:34:41 UTC
Permalink
Angel Tsankov wrote:
> Hmm, I had disabled "Loadable module support" prior to rebuilding the
> kernel. This should mean that the PPPoE module is built into the kernel
> and is therefore always loaded, right?

What does your kernel .config say? It should say

CONFIG_PPP=y
CONFIG_PPPOE=y

Andy
Angel Tsankov
2006-06-07 13:12:07 UTC
Permalink
>> Hmm, I had disabled "Loadable module support" prior to rebuilding the kernel. This should mean that the PPPoE module is built
>> into the kernel and is therefore always loaded, right?
>
> What does your kernel .config say? It should say
>
> CONFIG_PPP=y
> CONFIG_PPPOE=y

Btw, how do you know that I need to build the PPPoE module? The BLFS book says that in order to install the PPP package I only need
support for PPP:
Note
PPP support must be compiled into the kernel or available as a kernel module.
Andrew Benton
2006-06-07 20:13:28 UTC
Permalink
Angel Tsankov wrote:
>> CONFIG_PPP=y
>> CONFIG_PPPOE=y
>
> Btw, how do you know that I need to build the PPPoE module?

In an earlier post you mentioned installing RP-PPPoE, and in your
/etc/ppp/options file, you said you had the line
plugin rp-pppoe

Andy
Angel Tsankov
2006-06-08 11:31:04 UTC
Permalink
>>> CONFIG_PPP=y
>>> CONFIG_PPPOE=y
>>
>> Btw, how do you know that I need to build the PPPoE module?
>
> In an earlier post you mentioned installing RP-PPPoE, and in your
> /etc/ppp/options file, you said you had the line
> plugin rp-pppoe

Aha, and do I need to have any of the RP-PPPoE configuration files for the rp-pppoe plugin to work, e.g. /etc/ppp/pppoe.conf?
Randy McMurchy
2006-06-08 11:38:45 UTC
Permalink
Angel Tsankov wrote these words on 06/08/06 06:31 CST:

> Aha, and do I need to have any of the RP-PPPoE configuration files for the rp-pppoe plugin to work, e.g. /etc/ppp/pppoe.conf?

Couldn't you answer that on your own by simply trying it?

If it works without the config file, then you don't need it.

If it doesn't work until you use the config file, then you need it.

Try to do a little on your own and not just ask a question about
every single little thing.

--
Randy

rmlscsi: [bogomips 1003.27] [GNU ld version 2.16.1] [gcc (GCC) 4.0.3]
[GNU C Library stable release version 2.3.6] [Linux 2.6.14.3 i686]
06:36:00 up 26 days, 22:36, 1 user, load average: 0.00, 0.00, 0.00
Angel Tsankov
2006-06-07 14:08:02 UTC
Permalink
>> Hmm, I had disabled "Loadable module support" prior to rebuilding the
>> kernel. This should mean that the PPPoE module is built into the kernel
>> and is therefore always loaded, right?
>
> What does your kernel .config say? It should say
>
> CONFIG_PPP=y
> CONFIG_PPPOE=y

Now it does, but when I reboot the system after installing the kernel I get a lot of lines reading:
./hotplug.functions: line 113: /lib/modules/2.6.11.12/modules/isapnpmap: No such file or directory

and some more lines reading as follows:
Opening /proc/modules: No such file or directory
modprobe: FATAL: Could not load /lib/modules/2.6.11.12/modules.dep: No such file or directory

Do I need to enable "Loadable module support" in order to use the PPPoE module?
Alexander E. Patrakov
2006-06-07 15:22:35 UTC
Permalink
Angel Tsankov wrote:
> Now it does, but when I reboot the system after installing the kernel I
> get a lot of lines reading:
> ./hotplug.functions: line 113:
> /lib/modules/2.6.11.12/modules/isapnpmap: No such file or directory

Known bug with /etc/hotplug/pnp.rc. Remove that file, because it only loads
modules and you don't even have support for them.

> Do I need to enable "Loadable module support" in order to use the PPPoE
> module?

No.

--
Alexander E. Patrakov
Angel Tsankov
2006-06-07 18:15:31 UTC
Permalink
> Angel Tsankov wrote:
>> Now it does, but when I reboot the system after installing the kernel I
>> get a lot of lines reading:
>> ./hotplug.functions: line 113:
>> /lib/modules/2.6.11.12/modules/isapnpmap: No such file or directory
>
> Known bug with /etc/hotplug/pnp.rc. Remove that file, because it only loads
> modules and you don't even have support for them.
>
I removed teh /etc/hotplug/pnp.rc file the I no longer get any of the above messages. Thanks!

>> Do I need to enable "Loadable module support" in order to use the PPPoE
>> module?
>
> No.
Alexander E. Patrakov
2006-06-07 15:21:07 UTC
Permalink
Angel Tsankov wrote:
> Hmm, I had disabled "Loadable module support" prior to rebuilding the
> kernel. This should mean that the PPPoE module is built into the kernel
> and is therefore always loaded, right?

No, this means that the module is not built into the kernel and never loaded.
You can build it into the kernel, though, and this would fix your problem.

--
Alexander E. Patrakov
Angel Tsankov
2006-06-07 18:14:23 UTC
Permalink
> Angel Tsankov wrote:
>> Hmm, I had disabled "Loadable module support" prior to rebuilding the
>> kernel. This should mean that the PPPoE module is built into the kernel
>> and is therefore always loaded, right?
>
> No, this means that the module is not built into the kernel and never loaded.
> You can build it into the kernel, though, and this would fix your problem.

How do I build the PPPoE module into the kernel?
Alexander E. Patrakov
2006-06-08 03:33:18 UTC
Permalink
Angel Tsankov wrote:
> How do I build the PPPoE module into the kernel?

CONFIG_EXPERIMENTAL=y
(that's under Code maturity level options -> Prompt for development and/or
incomplete code/drivers)

CONFIG_PPPOE=y
(that's under Device drivers -> Network device support -> PPP over Ethernet
(EXPERIMENTAL))

--
Alexander E. Patrakov
Angel Tsankov
2006-06-08 11:40:29 UTC
Permalink
>> How do I build the PPPoE module into the kernel?
>
> CONFIG_EXPERIMENTAL=y
> (that's under Code maturity level options -> Prompt for development and/or incomplete code/drivers)
>
> CONFIG_PPPOE=y
> (that's under Device drivers -> Network device support -> PPP over Ethernet (EXPERIMENTAL))

Yes, I do have the above two lines in the .config file. This means that the PPPoE module is built into the
kernel. and the suggestion about the PPPoE module not loaded should be wrong. What other reason could there be for the PPPoE
connection not being established?
Alexander E. Patrakov
2006-06-09 03:54:01 UTC
Permalink
Angel Tsankov wrote:
>>> How do I build the PPPoE module into the kernel?
>>
>> CONFIG_EXPERIMENTAL=y
>> (that's under Code maturity level options -> Prompt for development
>> and/or incomplete code/drivers)
>>
>> CONFIG_PPPOE=y
>> (that's under Device drivers -> Network device support -> PPP over
>> Ethernet (EXPERIMENTAL))
>
> Yes, I do have the above two lines in the .config file. This means that
> the PPPoE module is built into the
> kernel. and the suggestion about the PPPoE module not loaded should be
> wrong. What other reason could there be for the PPPoE connection not
> being established?

Maybe you missed CONFIG_PACKET=y.

If this guess is wrong, you have two roads for debugging this:

1) Mail your kernel .config to me privately, so that I can look at it instead of
guessing.

2) Download the known good config from

http://wiki.linuxfromscratch.org/livecd/browser/trunk/packages/linux/config.x86?format=raw

Download the 2.6.16.20 kernel from kernel.org, save the config as
linux-2.6.16.20/.config, run "make oldconfig" (because the LiveCD kernel is
patched and thus the config above is not exactly for 2.6.16.20 kernel), then
build the kernel as usual (you may want to add sound, put please don't remove
anything). Old udev won't fully work with that kernel, but you still should be
able to:

ip link set eth0 up
modprobe pppoe
pppd call pppoe

--
Alexander E. Patrakov
Alexander E. Patrakov
2006-06-09 14:39:57 UTC
Permalink
Angel Tsankov wrote:
> I verified I have CONFIG_PACKET=y in my .config file.
>
>> If this guess is wrong, you have two roads for debugging this:
>>
>> 1) Mail your kernel .config to me privately, so that I can look at it
>> instead of guessing.
>
> Sure, I have attached the compressed kernel configuration file.

After adding support for my hardware and making "oldconfig" with newer kernel,
this config _worked_ for me. I can't run an old kernel due to new udev, sorry.
So let's assume this is either a 2.6.11 specific problem, or not a kernel
problem at all. Please install strace and post the output of:

strace -e open,socket pppd call pppoe debug nodetach

together with all files in /etc/ppp that are mentioned in that log, plus your
firewall configuration, if any.

>> 2) Download the known good config from
>>
>> http://wiki.linuxfromscratch.org/livecd/browser/trunk/packages/linux/config.x86?format=raw
>
> I will probably try these steps later on as the last way out of this
> problem. My argument in favor of this decision is that being able to
> make the PPPoE connection work (using RP-PPPoE along with WvDial,
> WvStreams and OpenSSL) is an indication that the problem has smth to do
> with configuration of existing software (ppp package and/or rp-pppoe.so
> module for example) rather that the software itself (kernel version for
> example)? Could this assumption be wrong?

It could, because there are two ways to configure pppoe with rp-pppoe:
kernel-mode pppoe and user-mode pppoe. If one works, there is no reason to
assume that the other will work. With the PPP package alone, only kernel-mode
pppoe is available, so your assumption breaks if you were using user-mode pppoe
(the default with rp-pppoe).

--
Alexander E. Patrakov
Angel Tsankov
2006-06-09 21:37:50 UTC
Permalink
>> I will probably try these steps later on as the last way out of this problem. My argument in favor of this decision is that being
>> able to make the PPPoE connection work (using RP-PPPoE along with WvDial, WvStreams and OpenSSL) is an indication that the
>> problem has smth to do with configuration of existing software (ppp package and/or rp-pppoe.so module for example) rather that
>> the software itself (kernel version for example)? Could this assumption be wrong?
>
> It could, because there are two ways to configure pppoe with rp-pppoe:
> kernel-mode pppoe and user-mode pppoe. If one works, there is no reason to
> assume that the other will work. With the PPP package alone, only kernel-mode
> pppoe is available, so your assumption breaks if you were using user-mode pppoe
> (the default with rp-pppoe).

Ahaa, so I'm going to try kernel-mode PPPoE with RP-PPPoE 3.8 now. I took a look at the doc/KERNEL-MODE-PPPOE file. It says that I
must have the following kernel configuration settings:
CONFIG_PPP=m or CONFIG_PPP=y
CONFIG_PPP_ASYNC=m or CONFIG_PPP_ASYNC=y
CONFIG_PPP_SYNC_TTY=m or CONFIG_PPP_SYNC_TTY=y
CONFIG_PPP_DEFLATE=m or CONFIG_PPP_DEFLATE=y
CONFIG_PPP_BSDCOMP=m or CONFIG_PPP_BSDCOMP=y
CONFIG_PPPOE=m or CONFIG_PPPOE=y
CONFIG_N_HDLC=m or CONFIG_N_HDLC=y
CONFIG_UNIX98_PTYS=y

I have all of them except for CONFIG_N_HDLC. Can someone tell me where I can find this option? I'm building kernel 2.6.11.12.
Andrew Benton
2006-06-09 23:55:49 UTC
Permalink
Angel Tsankov wrote:
> I have all of them except for CONFIG_N_HDLC. Can someone tell me where I
> can find this option? I'm building kernel 2.6.11.12.

Device Drivers --->
Character devices --->
[*] Non-standard serial port support
[*] HDLC line discipline support

Andy
Angel Tsankov
2006-06-10 09:19:31 UTC
Permalink
>> I have all of them except for CONFIG_N_HDLC. Can someone tell me where I can find this option? I'm building kernel 2.6.11.12.
>
> Device Drivers --->
> Character devices --->
> [*] Non-standard serial port support
> [*] HDLC line discipline support

Thanks, Andy.

I followed the instruction in the doc/KERNEL-MODE-PPPOE file in rp-pppoe 3.8 package and managed to connect to my ISP. How can I
check if I am using kernel-mode or user-mode PPPoE?

Here's what I did:

0) Make sure you are running kernel 2.4.x on the machine you will build
rp-pppoe on. You must have the following kernel configuration settings:

CONFIG_PPP=m or CONFIG_PPP=y
CONFIG_PPP_ASYNC=m or CONFIG_PPP_ASYNC=y
CONFIG_PPP_SYNC_TTY=m or CONFIG_PPP_SYNC_TTY=y
CONFIG_PPP_DEFLATE=m or CONFIG_PPP_DEFLATE=y
CONFIG_PPP_BSDCOMP=m or CONFIG_PPP_BSDCOMP=y
CONFIG_PPPOE=m or CONFIG_PPPOE=y
CONFIG_N_HDLC=m or CONFIG_N_HDLC=y # I have all the other options except for this one
CONFIG_UNIX98_PTYS=y

You also need a /dev/ppp file:

mknod --mode=664 /dev/ppp c 108 0 # this file exists with permission crw-rw---- and is owned by user root, group root.

You might want to add these lines to /etc/modules.conf ( I did not add these, since the kernel does not use modules):

alias char-major-108 ppp_generic
alias tty-ldisc-3 ppp_async
alias tty-ldisc-13 n_hdlc
alias tty-ldisc-14 ppp_synctty
alias net-pf-24 pppoe

1) If you are running pppd older than 2.4.0, check out the latest
version of the PPP software from the CVS repository at cvs.samba.org.
Here's how to do this:
# I am running pppd 2.4.3, so I skipped this step
cvs -d :pserver:cvs at pserver.samba.org:/cvsroot login
# When prompted for a password, type "cvs"

# Change to the directory in which you want to store the PPP source
# code.
cd /path/to/checked/out/sources

# Check out the source
cvs -z5 -d :pserver:cvs at pserver.samba.org:/cvsroot co ppp

If you are running pppd 2.4.0 or newer, and have the pppd development
headers installed, you can skip steps 1 and 2.
# I skipped step 2, too.

2) The source gets checked out into a subdirectory called ppp. If
the source ends up in /path/to/checked/out/sources/ppp, then call
that path $PPPDIR.

Build and install the checked-out ppp code according to its instructions.

3) Unpack rp-pppoe.

4) In the rp-pppoe directory, change to src/ and type:

./configure --enable-plugin=$PPPDIR
# I issued the command that follows instead

where $PPPDIR, of course, refers to the checked-out "ppp" directory
from cvs.samba.org.

If you didn't check out the PPP software from cvs.samba.org, use:

./configure --enable-plugin

4) Type make; make install
# done

5) Edit /etc/ppp/pppoe.conf to include this line:
LINUX_PLUGIN=/etc/ppp/plugins/rp-pppoe.so
#done after issuing pppoe-setup

After that, pppoe-start should use kernel-mode PPPoE.
# yes, pppoe-start did connect to my ISP and I manged to ping a host on the Internet by IP addres

How can I be usre that I'm using kernel-mode PPPoE in this case?
Alexander E. Patrakov
2006-06-10 11:44:37 UTC
Permalink
Angel Tsankov wrote:
> How can I be sure that I'm using kernel-mode PPPoE in this case?

Very easy.

1) "pidof pppoe" should return nothing.
2) "pidof pppd" should return only one process ID, not two IDs.
3) "ls -l /proc/`pidof pppd`/fd" should not reference /dev/pts

--
Alexander E. Patrakov
Angel Tsankov
2006-06-10 13:21:26 UTC
Permalink
>> How can I be sure that I'm using kernel-mode PPPoE in this case?
>
> Very easy.
>
> 1) "pidof pppoe" should return nothing.
> 2) "pidof pppd" should return only one process ID, not two IDs.
> 3) "ls -l /proc/`pidof pppd`/fd" should not reference /dev/pts

In the meanwhile I followed the instructions on http://wiki.linuxfromscratch.org/blfs/wiki/PPP and happily, I managed to connect to
my ISP's PPPoE server using the PPP package only - no WvDial, WvStreams, OpenSSL or RP-PPPoE (except for the rp-pppoe.so plugin
included in the PPP package)! Then I executed the above 3 commands and the results exactly matched what you said they should match
for kernel-mode pppoe. Thanks to everyone who took part in this thread for your patience and advice.

Now there is one more thing about the PPPoE connection I would like to setup - I want to have it established at boot time. As far as
I know I need to have the following files:

1) /etc/sysconfig/network-devices/ifconfig.eth0/pppoe:
ONBOOT="yes"
SERVICE="pppoe"
2) /etc/sysconfig/network-devices/services/pppoe:

#!/bin/sh
. /etc/sysconfig/rc
. $rc_functions

case "$2" in
up)
boot_mesg "Bringing up the PPPoE interface..."

issue ip link set <ethN> up
pppd call <peername>
evaluate_retval
;;

down)
boot_mesg "Bringing down the PPPoE interface..."
killall pppd
evaluate_retval
;;

*)
echo "Usage: $0 {up|down}"
exit 1
;;
esac

The question is how do I know the value of N in <ethN>.
The other thing I want is to have the PPPoE connection reestablished if it breaks. Is this automatically handled or do I need to
setup smth?
Alexander E. Patrakov
2006-06-10 14:38:47 UTC
Permalink
Angel Tsankov wrote:
> Now there is one more thing about the PPPoE connection I would like to
> setup - I want to have it established at boot time. As far as I know I
> need to have the following files:
>
> 1) /etc/sysconfig/network-devices/ifconfig.eth0/pppoe:
> ONBOOT="yes"
> SERVICE="pppoe"
> 2) /etc/sysconfig/network-devices/services/pppoe:
>
> #!/bin/sh
> . /etc/sysconfig/rc
> . $rc_functions
>
> case "$2" in
> up)
> boot_mesg "Bringing up the PPPoE interface..."
>
> ip link set <ethN> up
> pppd call <peername>
> evaluate_retval
> ;;
>
> down)
> boot_mesg "Bringing down the PPPoE interface..."
> killall pppd
> evaluate_retval
> ;;
>
> *)
> echo "Usage: $0 {up|down}"
> exit 1
> ;;
> esac
>
> The question is how do I know the value of N in <ethN>.

ethN is passed as the argument to the bootscript and, thus, is accessible as ${1}.

Probably (untested, I have a custom script not using the service model) you can
do the following:

1) Don't specify the network interface name in /etc/ppp/peers/pppoe
2) In the "up" part, run this:

ip link set ${1} up
loadproc -p /var/run/ppp-${1}.pid pppd call pppoe nic-${1} updetach linkname ${1}

No need to evaluate_retval

(the "nic-" prefix is needed so that it works even with network interfaces
renamed to "realtek" or something like that. "updetach" is needed so that you
can be 100% sure that pppd doesn't go into background until establishing the
connection, so that e.g. ntpd could start correctly. "linkname" is for a
predictable pid file name)

3) In the "down" part, it is better to do this:

killproc -p /var/run/ppp-${1}.pid

Again, no need to evaluate_retval

Please report if this works for you with or without modifications.

> The other thing I want is to have the PPPoE connection reestablished if
> it breaks. Is this automatically handled or do I need to setup smth?

You have to add the following options to /etc/ppp/peers/pppoe:

persist
holdoff 15
lcp-echo-interval 30
lcp-echo-failure 3

This way, pppd will retry in 15 seconds after it knows that the connection
broke. Also, it will send echo requests to the peer every 30 seconds, and
failure to answer 3 requests counts as link failure.

--
Alexander E. Patrakov
Alexander E. Patrakov
2006-06-10 14:46:22 UTC
Permalink
I wrote:
> killproc -p /var/run/ppp-${1}.pid

Oops, should be:

killproc -p /var/run/ppp-${1}.pid pppd

--
Alexander E. Patrakov
Angel Tsankov
2006-06-11 20:13:35 UTC
Permalink
>> Now there is one more thing about the PPPoE connection I would like to setup - I want to have it established at boot time. As far
>> as I know I need to have the following files:
>>
>> 1) /etc/sysconfig/network-devices/ifconfig.eth0/pppoe:
>> ONBOOT="yes"
>> SERVICE="pppoe"
>> 2) /etc/sysconfig/network-devices/services/pppoe:
>>
>> #!/bin/sh
>> . /etc/sysconfig/rc
>> . $rc_functions
>>
>> case "$2" in
>> up)
>> boot_mesg "Bringing up the PPPoE interface..."
>>
>> ip link set <ethN> up
>> pppd call <peername>
>> evaluate_retval
>> ;;
>>
>> down)
>> boot_mesg "Bringing down the PPPoE interface..."
>> killall pppd
>> evaluate_retval
>> ;;
>>
>> *)
>> echo "Usage: $0 {up|down}"
>> exit 1
>> ;;
>> esac
>>
>> The question is how do I know the value of N in <ethN>.
>
> ethN is passed as the argument to the bootscript and, thus, is accessible as ${1}.
>
> Probably (untested, I have a custom script not using the service model) you can do the following:
>
> 1) Don't specify the network interface name in /etc/ppp/peers/pppoe
> 2) In the "up" part, run this:
>
> ip link set ${1} up
> loadproc -p /var/run/ppp-${1}.pid pppd call pppoe nic-${1} updetach linkname ${1}
>
> No need to evaluate_retval
>
> (the "nic-" prefix is needed so that it works even with network interfaces renamed to "realtek" or something like that. "updetach"
> is needed so that you can be 100% sure that pppd doesn't go into background until establishing the connection, so that e.g. ntpd
> could start correctly. "linkname" is for a predictable pid file name)
>
> 3) In the "down" part, it is better to do this:
>
> killproc -p /var/run/ppp-${1}.pid pppd
>
> Again, no need to evaluate_retval
>
> Please report if this works for you with or without modifications.

Yes, it works without modifications. Here's the relevant output:

Bringing up the eth0 interface...
Plugin ip-pppoe.so loaded.
RP-PPPoE plugin version 3.3 compiled against pppd 2.4.3
Using interface ppp0
Connect ppp0 <--> eth0
Couldn't increase MTU to 1500
Couldn't increase MTU to 1500
Couldn't increase MTU to 1500
PAP authentication succeeded
peer calling from number [MAC] authorized
local IP address [...]
remote IP address [...]
primary DNS address [...]
secondary DNS address [...]

Is the "Couldn't increase MTU to 1500" message harmless? If not, how can I avoid it (I already tried adding "mru 1280" and "mtu
1280" to the /etc/ppp/peers/pppoe file)?
How can I specify which PPPoE server I want to connect to when more than one is available?
It seems that /etc/ppp/ip-up does not get called; how do I inform bind where to forward DNS queries?

>> The other thing I want is to have the PPPoE connection reestablished if it breaks. Is this automatically handled or do I need to
>> setup smth?
>
> You have to add the following options to /etc/ppp/peers/pppoe:
>
> persist
> holdoff 15
> lcp-echo-interval 30
> lcp-echo-failure 3
>
> This way, pppd will retry in 15 seconds after it knows that the connection broke. Also, it will send echo requests to the peer
> every 30 seconds, and failure to answer 3 requests counts as link failure.

I have not tested this yet, but I guess it would work just fine.
Alexander E. Patrakov
2006-06-12 04:19:42 UTC
Permalink
Angel Tsankov wrote:
> Is the "Couldn't increase MTU to 1500" message harmless?

Yes.

> If not, how can
> I avoid it (I already tried adding "mru 1280" and "mtu 1280" to the
> /etc/ppp/peers/pppoe file)?

You tried the correct options, not sure why they don't work. The correct value
for mru and mtu is 1492, BTW.

> How can I specify which PPPoE server I want to connect to when more than
> one is available?

There are the following options:

rp_pppoe_service <string>: Desired PPPoE service name
rp_pppoe_ac <string>: Desired PPPoE access concentrator name
rp_pppoe_verbose <int>: Be verbose about discovered access concentrators

> It seems that /etc/ppp/ip-up does not get called; how do I inform bind
> where to forward DNS queries?

You probably didn't chmod the file to 755.

--
Alexander E. Patrakov
Angel Tsankov
2006-06-12 18:50:30 UTC
Permalink
> You tried the correct options, not sure why they don't work. The correct value
> for mru and mtu is 1492, BTW.

Hmm, I put "mtu 1492" and "mru 1492" in the /etc/ppp/peers/pppoe file, but I still get the "Couldn't increase MTU to 1500" message:

plugin rp-pppoe.so
user <username>
noauth
defaultroute
usepeerdns
mtu 1492
mru 1492
persist
holdoff 15
lcp-echo-interval 30
lcp-echo-failure 3

>> How can I specify which PPPoE server I want to connect to when more than
>> one is available?
>
> There are the following options:
>
> rp_pppoe_service <string>: Desired PPPoE service name
> rp_pppoe_ac <string>: Desired PPPoE access concentrator name
> rp_pppoe_verbose <int>: Be verbose about discovered access concentrators

These options seem to work. Where are they documented?
Alexander E. Patrakov
2006-06-13 05:51:13 UTC
Permalink
Angel Tsankov wrote:
>> You tried the correct options, not sure why they don't work. The
>> correct value for mru and mtu is 1492, BTW.
>
> Hmm, I put "mtu 1492" and "mru 1492" in the /etc/ppp/peers/pppoe file,
> but I still get the "Couldn't increase MTU to 1500" message:

I need the output of "pppd call pppoe dryrun" in order to debug this.

>>> How can I specify which PPPoE server I want to connect to when more
>>> than one is available?
>>
>> There are the following options:
>>
>> rp_pppoe_service <string>: Desired PPPoE service name
>> rp_pppoe_ac <string>: Desired PPPoE access concentrator name
>> rp_pppoe_verbose <int>: Be verbose about discovered access concentrators
>
> These options seem to work. Where are they documented?

I got it directly from the source code :( but I guess that they are documented
somewhere in the rp-pppoe package.

--
Alexander E. Patrakov
Angel Tsankov
2006-06-13 18:07:23 UTC
Permalink
>>> You tried the correct options, not sure why they don't work. The
>>> correct value for mru and mtu is 1492, BTW.
>>
>> Hmm, I put "mtu 1492" and "mru 1492" in the /etc/ppp/peers/pppoe file,
>> but I still get the "Couldn't increase MTU to 1500" message:
>
> I need the output of "pppd call pppoe dryrun" in order to debug this.

Plugin rp-pppoe.so loaded.
RP-PPPoE plugin version 3.3 compiled against pppd 2.4.3

Hope this helps.
Alexander E. Patrakov
2006-06-14 03:42:37 UTC
Permalink
Angel Tsankov wrote:
>>>> You tried the correct options, not sure why they don't work. The
>>>> correct value for mru and mtu is 1492, BTW.
>>>
>>> Hmm, I put "mtu 1492" and "mru 1492" in the /etc/ppp/peers/pppoe
>>> file, but I still get the "Couldn't increase MTU to 1500" message:
>>
>> I need the output of "pppd call pppoe dryrun" in order to debug this.
>
> Plugin rp-pppoe.so loaded.
> RP-PPPoE plugin version 3.3 compiled against pppd 2.4.3
>
> Hope this helps.

No, that doesn't.

pppd call pppoe dryrun eth0

--
Alexander E. Patrakov
Angel Tsankov
2006-06-14 11:35:15 UTC
Permalink
>>>>> You tried the correct options, not sure why they don't work. The
>>>>> correct value for mru and mtu is 1492, BTW.
>>>>
>>>> Hmm, I put "mtu 1492" and "mru 1492" in the /etc/ppp/peers/pppoe
>>>> file, but I still get the "Couldn't increase MTU to 1500" message:
>>>
>>> I need the output of "pppd call pppoe dryrun" in order to debug this.
>>
>> Plugin rp-pppoe.so loaded.
>> RP-PPPoE plugin version 3.3 compiled against pppd 2.4.3
>>
>> Hope this helps.
>
> No, that doesn't.
>
> pppd call pppoe dryrun eth0

This seems to produce some more info. Here it is (the peer file for this PPPoE connection is called megalan53):

Plugin rp-pppoe.so loaded.
RP-PPPoE plugin version 3.3 compiled against pppd 2.4.3
pppd options in effect:
holdoff 15 # (from /etc/ppp/peers/megalan53)
persist # (from /etc/ppp/peers/megalan53)
dryrun # (from command line)
plugin rp-pppoe.so # (from /etc/ppp/peers/megalan53)
noauth # (from /etc/ppp/peers/megalan53)
user sven # (from /etc/ppp/peers/megalan53)
eth0 # (from command line)
rp_pppoe_service megalan53 # (from /etc/ppp/peers/megalan53)
eth0 # (from command line)
rp_pppoe_service megalan53 # (from /etc/ppp/peers/megalan53)
mru 1492 # (from /etc/ppp/peers/megalan53)
mtu 1492 # (from /etc/ppp/peers/megalan53)
lcp-echo-failure 3 # (from /etc/ppp/peers/megalan53)
lcp-echo-interval 30 # (from /etc/ppp/peers/megalan53)
defaultroute # (from /etc/ppp/peers/megalan53)
usepeerdns # (from /etc/ppp/peers/megalan53)

If you need further assistance in tackling this issue just let me know.
Alexander E. Patrakov
2006-06-14 11:56:03 UTC
Permalink
Angel Tsankov wrote:
>> pppd call pppoe dryrun eth0
>
> This seems to produce some more info. Here it is (the peer file for this
> PPPoE connection is called megalan53):
>
> Plugin rp-pppoe.so loaded.
> RP-PPPoE plugin version 3.3 compiled against pppd 2.4.3
> pppd options in effect:
> holdoff 15 # (from /etc/ppp/peers/megalan53)
> persist # (from /etc/ppp/peers/megalan53)
> dryrun # (from command line)
> plugin rp-pppoe.so # (from /etc/ppp/peers/megalan53)
> noauth # (from /etc/ppp/peers/megalan53)
> user sven # (from /etc/ppp/peers/megalan53)
> eth0 # (from command line)
> rp_pppoe_service megalan53 # (from /etc/ppp/peers/megalan53)
> eth0 # (from command line)
> rp_pppoe_service megalan53 # (from /etc/ppp/peers/megalan53)
> mru 1492 # (from /etc/ppp/peers/megalan53)
> mtu 1492 # (from /etc/ppp/peers/megalan53)
> lcp-echo-failure 3 # (from /etc/ppp/peers/megalan53)
> lcp-echo-interval 30 # (from /etc/ppp/peers/megalan53)
> defaultroute # (from /etc/ppp/peers/megalan53)
> usepeerdns # (from /etc/ppp/peers/megalan53)
>
> If you need further assistance in tackling this issue just let me know.

Still doesn't help. Could you please, after connecting, issue this command:

ip link list

and paste the entire output. But if that doesn't show the problem, I give up.

--
Alexander E. Patrakov
Angel Tsankov
2006-06-14 18:17:27 UTC
Permalink
> Angel Tsankov wrote:
>>> pppd call pppoe dryrun eth0
>>
>> This seems to produce some more info. Here it is (the peer file for this
>> PPPoE connection is called megalan53):
>>
>> Plugin rp-pppoe.so loaded.
>> RP-PPPoE plugin version 3.3 compiled against pppd 2.4.3
>> pppd options in effect:
>> holdoff 15 # (from /etc/ppp/peers/megalan53)
>> persist # (from /etc/ppp/peers/megalan53)
>> dryrun # (from command line)
>> plugin rp-pppoe.so # (from /etc/ppp/peers/megalan53)
>> noauth # (from /etc/ppp/peers/megalan53)
>> user sven # (from /etc/ppp/peers/megalan53)
>> eth0 # (from command line)
>> rp_pppoe_service megalan53 # (from /etc/ppp/peers/megalan53)
>> eth0 # (from command line)
>> rp_pppoe_service megalan53 # (from /etc/ppp/peers/megalan53)
>> mru 1492 # (from /etc/ppp/peers/megalan53)
>> mtu 1492 # (from /etc/ppp/peers/megalan53)
>> lcp-echo-failure 3 # (from /etc/ppp/peers/megalan53)
>> lcp-echo-interval 30 # (from /etc/ppp/peers/megalan53)
>> defaultroute # (from /etc/ppp/peers/megalan53)
>> usepeerdns # (from /etc/ppp/peers/megalan53)
>>
>> If you need further assistance in tackling this issue just let me know.
>
> Still doesn't help. Could you please, after connecting, issue this command:
>
> ip link list
>
> and paste the entire output. But if that doesn't show the problem, I give up.

Hmm, eth0 has mtu=1500, I guess this might be the problem:

1: eth0: <BROADCAST,MULTICAST,UP> mtu 1500 qdisc pfifo_fast qlen 1000
link/ether 00:0c:29:41:f1:c1 brd ff:ff:ff:ff:ff:ff
2: lo: <LOOPBACK,UP> mtu 16436 qdisc noqueue
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
3: dummy0: <BROADCAST,NOARP> mtu 1500 qdisc noop
link/ether 3e:82:66:ca:40:4f brd ff:ff:ff:ff:ff:ff
4: ppp0: <POINTOPOINT,MULTICAST,NOARP,UP> mtu 1492 qdisc pfifo_fast qlen 3
link/ppp

I have also attached the /etc/ppp/options and /etc/ppp/peers/megalan53 files.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: etc-ppp.tar.gz
Type: application/octet-stream
Size: 415 bytes
Desc: not available
URL: <http://lists.linuxfromscratch.org/pipermail/blfs-support/attachments/20060614/cf0ff54e/attachment.obj>
Alexander E. Patrakov
2006-06-15 03:46:33 UTC
Permalink
Angel Tsankov wrote:
> Hmm, eth0 has mtu=1500, I guess this might be the problem:

No, that's correct. eth0 must have mtu at least mtu_of_ppp0 + 8.

> I have also attached the /etc/ppp/options and /etc/ppp/peers/megalan53
> files.

Try moving mtu and mru statements in /etc/ppp/peers/megalan53 to the very top.
If this doesn't help, I give up.

--
Alexander E. Patrakov
Angel Tsankov
2006-06-15 09:11:21 UTC
Permalink
> Try moving mtu and mru statements in /etc/ppp/peers/megalan53 to the very top.
> If this doesn't help, I give up.

Unfortunately, this did not help. Could you explain in a few words why I get this message and where I could find further assistance?
Alexander E. Patrakov
2006-06-15 09:58:11 UTC
Permalink
Angel Tsankov wrote:
>> Try moving mtu and mru statements in /etc/ppp/peers/megalan53 to the
>> very top. If this doesn't help, I give up.
>
> Unfortunately, this did not help. Could you explain in a few words why I
> get this message and where I could find further assistance?

You get this harmless message because the default mtu for ppp connections is
1500 (big mtu = low overhead for packet headers = better speed), and this is not
valid for pppoe (where the maximum allowed mtu/mru is 1492, because one IP
packet plus PPP headers must fit in one 1500-byte Ethernet packet). The end
result is correct, so you have nothing to worry about.

If you really want to know everythig about packet headers, try sniffing the
traffic on eth0 with WireShark (formerly known as Ethereal) and googling for
unknown words you see on the screen, plus the word "RFC".

--
Alexander E. Patrakov
Angel Tsankov
2006-06-15 10:29:36 UTC
Permalink
>>> Try moving mtu and mru statements in /etc/ppp/peers/megalan53 to the
>>> very top. If this doesn't help, I give up.
>>
>> Unfortunately, this did not help. Could you explain in a few words why I
>> get this message and where I could find further assistance?
>
> You get this harmless message because the default mtu for ppp connections is
> 1500 (big mtu = low overhead for packet headers = better speed), and this is not
> valid for pppoe (where the maximum allowed mtu/mru is 1492, because one IP
> packet plus PPP headers must fit in one 1500-byte Ethernet packet). The end
> result is correct, so you have nothing to worry about.
>
> If you really want to know everythig about packet headers, try sniffing the
> traffic on eth0 with WireShark (formerly known as Ethereal) and googling for
> unknown words you see on the screen, plus the word "RFC".

OK, thanks once again!
Angel Tsankov
2006-06-18 13:31:35 UTC
Permalink
>>> Now there is one more thing about the PPPoE connection I would like to setup - I want to have it established at boot time. As
>>> far as I know I need to have the following files:
>>>
>>> 1) /etc/sysconfig/network-devices/ifconfig.eth0/pppoe:
>>> ONBOOT="yes"
>>> SERVICE="pppoe"
>>> 2) /etc/sysconfig/network-devices/services/pppoe:
>>>
>>> #!/bin/sh
>>> . /etc/sysconfig/rc
>>> . $rc_functions
>>>
>>> case "$2" in
>>> up)
>>> boot_mesg "Bringing up the PPPoE interface..."
>>>
>>> ip link set <ethN> up
>>> pppd call <peername>
>>> evaluate_retval
>>> ;;
>>>
>>> down)
>>> boot_mesg "Bringing down the PPPoE interface..."
>>> killall pppd
>>> evaluate_retval
>>> ;;
>>>
>>> *)
>>> echo "Usage: $0 {up|down}"
>>> exit 1
>>> ;;
>>> esac
>>>
>>> The question is how do I know the value of N in <ethN>.
>>
>> ethN is passed as the argument to the bootscript and, thus, is accessible as ${1}.
>>
>> Probably (untested, I have a custom script not using the service model) you can do the following:
>>
>> 1) Don't specify the network interface name in /etc/ppp/peers/pppoe
>> 2) In the "up" part, run this:
>>
>> ip link set ${1} up
>> loadproc -p /var/run/ppp-${1}.pid pppd call pppoe nic-${1} updetach linkname ${1}
>>
>> No need to evaluate_retval
>>
>> (the "nic-" prefix is needed so that it works even with network interfaces renamed to "realtek" or something like that.
>> "updetach" is needed so that you can be 100% sure that pppd doesn't go into background until establishing the connection, so that
>> e.g. ntpd could start correctly. "linkname" is for a predictable pid file name)
>>
>> 3) In the "down" part, it is better to do this:
>>
>> killproc -p /var/run/ppp-${1}.pid pppd
>>
>> Again, no need to evaluate_retval
>>
>> Please report if this works for you with or without modifications.
>
> Yes, it works without modifications.

Btw, how do I query the status of the PPPoE connection?
Alexander E. Patrakov
2006-06-21 03:11:43 UTC
Permalink
Angel Tsankov wrote:

> Btw, how do I query the status of the PPPoE connection?

One of the following methods should work for you.

1) ip link list | grep ppp0
2) pidof pppd (from the script, you would prefer "pidofproc -p
/var/run/ppp-${1}.pid pppd")

--
Alexander E. Patrakov
Alexander E. Patrakov
2006-06-05 11:58:25 UTC
Permalink
Angel Tsankov wrote:
> I managed to setup a connection using RP-PPPoE after enabling PPP in the
> kernel and installing RP-PPPoE, WvStreams, WvDial and OpenSSL. However,
> I'd rather not install all 4 packages when a single one would do. So I
> read the instruction on
> http://wiki.linuxfromscratch.org/blfs/wiki/PPP
> and the README.pppoe file in the PPP package. Then I tried to setup a
> PPPoE connection (using only PPP) by ensuring the contents of some
> configuration files read as follows:

Don't mix-and-match different instructions. Please read only
http://wiki.linuxfromscratch.org/blfs/wiki/PPP (it had a "pp" vs "ppp" typo, now
fixed). You need the "DNS Server Configuration" and "PPPoE Connection" sections,
and also populate the files with secrets. Alternatively, download the 6.2-pre4
CD, run "net-setup" and model the settings after it.

As for the routing options that resulted in your inability to send packets, it's
because you have no "defaultroute" option and/or forgot to set the link up.

--
Alexander E. Patrakov
Loading...