Arch Linux

Please read this before reporting a bug:
https://wiki.archlinux.org/title/Bug_reporting_guidelines

Do NOT report bugs when a package is just outdated, or it is in the AUR. Use the 'flag out of date' link on the package page, or the Mailing List.

REPEAT: Do NOT report bugs for outdated packages!
Tasklist

FS#7663 - Additional PPP functionality for netcfg

Attached to Project: Arch Linux
Opened by Mark Constable (markc) - Wednesday, 25 July 2007, 02:19 GMT
Last edited by James Rayner (iphitus) - Wednesday, 13 February 2008, 10:16 GMT
Task Type Feature Request
Category System
Status Closed
Assigned To James Rayner (iphitus)
Architecture All
Severity Medium
Priority Normal
Reported Version 2007.05 Duke
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 0
Private No

Details

Description:

I could not find an obvious way to bring up a PPP(oE) interface after an ethernet interface was initialized so that a PC host could establish a PPP interface and authenticate via an ADSL modem in bridged mode (as opposed to 56K dialup).

Solution:

This may not be the best way to do it but I found by adding this simple extra option to /usr/bin/netcfg it then seems to offer the extra functionality I need...

start_profile()
{
...
# starting at line 180
if [ "$PPP" ]; then
pppd call $PPP
fi

Such that when a PPP=peers_profile variable is added to a netcfg profile then this optional extra pppd call is made. It allows for different pppd calling profiles to be used and may also be suitable for 56k dialup situations.

There does not seem to be the need for an equivalnet stop_profile() entry because stopping the ethernet interface kills the pppd process, however, a stop_profile() entry may be needed if this strategy was adopted for 56k dialup.

Additional info:
* initscripts 0.8-12
This task depends upon

This task blocks these from closing
Closed by  James Rayner (iphitus)
Wednesday, 13 February 2008, 10:16 GMT
Reason for closing:  Fixed
Additional comments about closing:  fixed in netcfg v2.0.6
Comment by Mark Constable (markc) - Wednesday, 25 July 2007, 04:55 GMT
I am probably confused about how /etc/rc.d/netowrk and /usr/bin/netcfg are meant to work together so my attempt above was not working reliably when adding bridges (I'm not sure if netcfg deals with BRIDGE_INTERFACES correctly when using profiles). I have tried again with /etc/rc.d/network and now have this working correctly with a simple /etc/rc.d/network start|stop.

Added these 2 functions to /etc/rc.d/network

ppp_up()
{
for ppp in ${PPP_PROFILES[@]}; do
if [ "$ppp" = "${ppp#!}" ]; then
pppd call $ppp > /dev/null 2>&1
fi
done
}

ppp_down()
{
for ppp in ${PPP_PROFILES[@]}; do
if [ "$ppp" = "${ppp#!}" ]; then
kill $(head -n 1 /var/run/ppp-$ppp.pid)
fi
done
}

and also added "ppp_up" to the bottom of start) and "ppp_down" to the top of stop). The stop function depends on "linkname something" being added to /etc/ppp/peers/profile so the right pppd PID file can be found to kill off the right pppd daemon. An example PPP profile file is...

# cat /etc/ppp/peers/pppoe
plugin rp-pppoe.so
br0
name "xxxxx"
usepeerdns
persist
defaultroute
noauth
debug
linkname pppoe

I'm using the "br0" device in this case so that qemu, and probably virtualbox/vmware, can use the local PC bridged interface and also access the outside world via the ADSL modem bridged interface. Here are the /etc/rc.conf settings that work for me...

BRIDGE_INTERFACES=(br0)
bridge_br0=(eth0)
br0="br0 192.168.1.2 netmask 255.255.255.0 broadcast 192.168.1.255"
eth0="eth0 0.0.0.0"
INTERFACES=(lo br0 eth0)
PPP_PROFILES=(pppoe)
ROUTES=()
Comment by Hussam Al-Tayeb (hussam) - Thursday, 26 July 2007, 01:45 GMT
for me '/etc/rc.d/adsl start' brings up my pppoe connection (of course it has to be done after networking is up)
Comment by Mark Constable (markc) - Thursday, 26 July 2007, 04:33 GMT
This method allows the option of multiple choices via the dialog menu (NET_PROFILES) including 56k dialup possibilities, as well as multiple PPP connections (for bonding 2 dialup connections for instance).
Comment by Janne Paalijarvi (usv) - Monday, 06 August 2007, 04:24 GMT
Here is the netcfg script I've been working on. It includes some of marc's suggestions. I've dropped ppp_up()/ppp_down() and handle ppp in general up() or down() sections. As suggested, the option "linkname" has to be in /etc/ppp/peers/myisp . For consistency, I have used the peer name as linkname too. Be sure NOT to use the "nodetach" option in peer file, as it probably hangs netcfg. When using ppp with netcfg you must define the interface in profile file (in /etc/network-profiles/someprofile) and the correct pper file with the PPP variable. For example (without the quotes): "PPP=myisp". You might also use the PPP_WAIT variable to define how long should pppd be allowed to wait before it is deemed unable to connect.

There are some other changes to netcfg too. I have introduced the PRESCRIPT variable. Stuff in this variable is run before setting the interface up. I use it like this: PRESCRIPT="/etc/Wireless/RT2500STA/craset.sh $INTERFACE homeconf" to set the config file for my legacy wlan driver. Also, I have included functionality for remembering the earlier network setup. It's nice for example when you need to reboot the machine, and want to choose the same network configuration than earlier. Information regarding last network profile is kept in /etc/network-profiles/.last . I have also versioned the script as 0.2 . Feel free to comment/use.
   netcfg (8.1 KiB)
Comment by James Rayner (iphitus) - Monday, 06 August 2007, 08:46 GMT
it'd probably be better to set this up with the new profile system, that will replace the current one.

http://wiki.archlinux.org/index.php/Network_Scripts

James
Comment by James Rayner (iphitus) - Monday, 10 December 2007, 23:11 GMT
I've created some sort of PPP setup and it's included in netcfg2. Please try tht.
Comment by James Rayner (iphitus) - Monday, 21 January 2008, 10:18 GMT
Anyone care to test the new netcfg2 ppp setup? I don't want to close this until _someone_ says it works
Comment by Hussam Al-Tayeb (hussam) - Monday, 21 January 2008, 11:27 GMT
If it can be tested with pppoe and there are instructions how to do it, I can do it. I've been using pppoe for years but I haven't touched netcfg or network scripts yet.
Comment by Roman Kyrylych (Romashka) - Monday, 21 January 2008, 14:18 GMT
@James: maybe post a query on arch-general or forums

Loading...