View previous topic :: View next topic |
Author |
Message |
dambacher Apprentice

Joined: 11 Feb 2003 Posts: 290 Location: Germany
|
Posted: Sat Jul 12, 2008 8:57 am Post subject: documtentation of pppd scripts mess |
|
|
Hi there
I just upgraded pppd and rp-pppoe and nothing worked anymore.
the scripts in /etc/ppp look horrible like work in progress with same code snipplets in different files, sometimes commented out, and i did not find any documentation on how and what works and how to insert customized code safely.
I need special routing and firewalling commands for each interface so i hat do deactivate the whole bunch by overwriting ip-up and ip-down completely.
Is there somebody out there who dived into this?
/dambacher
Last edited by dambacher on Wed Jul 16, 2008 5:17 am; edited 1 time in total |
|
Back to top |
|
 |
dambacher Apprentice

Joined: 11 Feb 2003 Posts: 290 Location: Germany
|
Posted: Sun Jul 13, 2008 12:32 pm Post subject: |
|
|
OK i took some time to figure it all out.
On my Server I found 3 packets wich put files into /etc/ppp
ppp
rp-pppoe
isdn4k-utils
And as this system runs gentoo since 2004, it saw different versions of baselayout and ppp.
I modified some of the files for my extended network setup, too.
And I use per device ip-up / ip-down scripts to setup extended routing tables.
so I have an /etc/ppp/ip-up.ppp0 or /etc/ppp/ip-up.ppp1 or /etc/ppp/ip-down.ppp0
and options.ppp0
The problem is that the new ppp version did not change ip-up if it was changed before,
and therefore etc-update did not show up anything.
So a mix of old and new config files was created.
This is no problen until the new ppp ebuild found a file "/etc/ppp/ip-up.local" and converted it to the new configuration schema (to /etc/ppp/ip-up.d/90-local) by renaming and moving it. Bam - no internet anymore.
This is how it should work now:
* you basically do all your ppp/pppoe configuration in /etc/conf/net
* with one exception: passwords go to /etc/ppp/pap-secrets
* you link net.lo to net.ppp0 etc. and activate them in your runlevel to make use of the configuration.
* the networking scripts of baselayout do the rest of the work and configure and fire up ppp.
* when the link is activated, the /etc/ppp/ip-up script is running. it sources every script in /etc/ppp/ip-up.d in alphanumerical order.
* So if you need further configuration just drop a file to /etc/ppp/ip-up.d or /etc/ppp/ip-down.d to do what you like.
This works same like with /etc/env.d or /etc/modules.d
Upgrade guide for pppd-scripters
before the upgrade:
* backup /etc/ppp for heavens sake!
* stop every ppp service
* put all your script modifications of ip-up and ip-down to /etc/ppp/ip-up.local or ip-down.local
* put all your options into /etc/conf.d/net. Look at /etc/conf.d/net.example on how to do it the gentoo way
(you don't need any "unit" configuration as the gentoo scripts handle this for you now)
* remove /etc/ppp/ip-up and /etc/ppp/ip-down
* you can leave your interface-special files (a relict from former versions) /etc/ppp/ip-up.ppp0 or alike where there are.
you shold have a line like
Code: | [ -f /etc/ppp/ip-up.$1 ] && source /etc/ppp/ip-up.$1 |
in your ip-up.local.
* emerge ppp
after the upgrade
* don't panic if your ip-up.local vanished. it is in /etc/ppp/ip-up.d/90-local.sh now. same with ip-down.local
* check /etc/ppp/ip-up.d/90-local.sh and /etc/ppp/ip-down.d/90-local.sh again
* check that /etc/ip-up looks like this:
Code: |
#!/bin/sh
# This script is run by pppd after the link is established.
# It executes all the scripts available in /etc/ppp/ip-up.d directory,
# with the following parameters:
# $1 = interface name (e.g. ppp0)
# $2 = tty device
# $3 = speed
# $4 = local IP address
# $5 = remote IP address
# $6 = ipparam (user specified parameter, see man pppd)
cd /etc/ppp/ip-up.d || exit
for SCRIPT in *.sh ; do
. ./"${SCRIPT}" "$@"
done
|
* ip-down should look alike
* cross your fingers, restart ppp services and try a ping.
* post here if it workd out or not
/dambacher |
|
Back to top |
|
 |
mrness Retired Dev


Joined: 17 Feb 2004 Posts: 375 Location: bucharest.ro
|
Posted: Fri Jul 18, 2008 6:48 am Post subject: |
|
|
dambacher wrote: | The problem is that the new ppp version did not change ip-up if it was changed before,
and therefore etc-update did not show up anything.
So a mix of old and new config files was created. |
That is strange. What package manager are you using?
dambacher wrote: | * with one exception: passwords go to /etc/ppp/pap-secrets |
The password_ppp0 problem of the baselayout-2 has been fixed in net-dialup/ppp-2.4.4-r17.
dambacher wrote: | * don't panic if your ip-up.local vanished. it is in /etc/ppp/ip-up.d/90-local.sh now. same with ip-down.local |
The ebuild gives you an einfo about ip-*.local move. |
|
Back to top |
|
 |
dambacher Apprentice

Joined: 11 Feb 2003 Posts: 290 Location: Germany
|
Posted: Fri Jul 18, 2008 9:36 am Post subject: |
|
|
Quote: |
dambacher wrote: | * don't panic if your ip-up.local vanished. it is in /etc/ppp/ip-up.d/90-local.sh now. same with ip-down.local |
The ebuild gives you an einfo about ip-*.local move. |
And how do I get emerge to log that into lines to ermerge.log ?
By the way, I tried it 3 times: emerge --unmerge ppp; emerge ppp; etc-update
At no time i got any files presented by etc-update. New files only appeared after I removed the old one.
Strange, but I did not find out why. I have no special settings for CONFIG_PROTECT and I use a plain unmodified portage. |
|
Back to top |
|
 |
zmedico Developer


Joined: 02 Jan 2004 Posts: 353 Location: California USA
|
Posted: Sat Jul 19, 2008 6:21 am Post subject: |
|
|
dambacher wrote: |
And how do I get emerge to log that into lines to ermerge.log ? |
Try /var/log/portage/elog/summary.log and see /etc/make.conf.example for elog docs.
dambacher wrote: |
By the way, I tried it 3 times: emerge --unmerge ppp; emerge ppp; etc-update
At no time i got any files presented by etc-update. New files only appeared after I removed the old one.
Strange, but I did not find out why. I have no special settings for CONFIG_PROTECT and I use a plain unmodified portage. |
Portage's "confmem" feature is a common source of confusion in cases like this. If you reinstall with --noconfmem then you should see the config updates that you've been looking for. See `man emerge` for more info about this option.
In newer versions of portage (those not marked stable yet), uninstalling a package or downgrading it will automatically trigger behavior like --noconfmem [1], so hopefully this will help to avoid some confusion in the future. _________________ Zac |
|
Back to top |
|
 |
dambacher Apprentice

Joined: 11 Feb 2003 Posts: 290 Location: Germany
|
Posted: Sat Jul 19, 2008 9:56 pm Post subject: |
|
|
thanks to zmedico
that were the right tips for me!
/dambacher |
|
Back to top |
|
 |
|