OpenWrt Forum Archive

Topic: pppoe with kamikaze

The content of this topic has been archived on 8 Apr 2018. There are no obvious gaps in this topic, but there may still be some posts missing at the end.

Today i tried pppoe with kamikaze and found some odd things:

my config:

config 'interface' 'wan'
        option 'ifname' 'eth1'
        option 'proto' 'pppoe'
        option 'username' '********@alice-dsl2.de'
        option 'password' '********'
        option 'mtu' '1468'

first try:

root@mb2-0_230-4:~# ifup wan
root@mb2-0_230-4:~# logread | grep ppp
Jul  1 12:31:35 mb2-0_230-4 daemon.info pppd[3237]: Plugin rp-pppoe.so loaded.
Jul  1 12:31:35 mb2-0_230-4 daemon.notice pppd[3238]: pppd 2.4.3 started by root, uid 0
Jul  1 12:31:35 mb2-0_230-4 daemon.err pppd[3238]: Interface eth1 has MTU of 1468 -- should be 1500.  You may have serious connection problems.
Jul  1 12:31:35 mb2-0_230-4 daemon.err pppd[3238]: sendPacket: send: Network is down
Jul  1 12:31:35 mb2-0_230-4 daemon.info pppd[3238]: Exit.

??? asking whats going wrong:

root@mb2-0_230-4:~# sh -x /sbin/ifup wan
+ [...]
+ /usr/sbin/pppd plugin rp-pppoe.so mtu 1468 mru 1468 nic-eth1 persist usepeerdns defaultroute replacedefaultroute user ********@alice-dsl2.de password ******** unit 0 linkname wan ipparam wan
+ lock -u /var/lock/ppp-wan

why "nic-eth1"?

root@mb2-0_230-4:~# vi /lib/network/pppoe.sh
        start_pppd "$config" \
                plugin rp-pppoe.so \
                mtu $mtu mru $mtu \
                "$iface" ### !!!edit!!! "nic-$iface" -> "$iface"

next try:

Jul  1 12:40:48 mb2-0_230-4 daemon.notice pppd[3380]: pppd 2.4.3 started by root, uid 0
Jul  1 12:40:48 mb2-0_230-4 daemon.err pppd[3380]: Interface eth1 has MTU of 1468 -- should be 1500.  You may have serious connection problems.
Jul  1 12:40:48 mb2-0_230-4 daemon.err pppd[3380]: sendPacket: send: Network is down
Jul  1 12:40:48 mb2-0_230-4 daemon.info pppd[3380]: Exit.

hmmm, still not better...? -> ok, google:http://linuxwiki.de/rp-pppoe

[...]
pre-up /sbin/ifconfig eth1 up   # <--- macht glücklich / makes happy ;-)
[...]

ok, so i edited pppoe.sh again:

        # pre-up physical device
        ifconfig "$iface" up
        start_pppd "$config" \
                plugin rp-pppoe.so \
                mtu $mtu mru $mtu \
                "$iface"

and last try:

root@mb2-0_230-4:~# ifup wan
root@mb2-0_230-4:~# logread | grep ppp
Jul  1 12:47:30 mb2-0_230-4 daemon.info pppd[3486]: Plugin rp-pppoe.so loaded.
Jul  1 12:47:30 mb2-0_230-4 daemon.notice pppd[3487]: pppd 2.4.3 started by root, uid 0
Jul  1 12:47:30 mb2-0_230-4 daemon.err pppd[3487]: Interface eth1 has MTU of 1468 -- should be 1500.  You may have serious connection problems.
Jul  1 12:47:30 mb2-0_230-4 daemon.info pppd[3487]: PPP session is 720
Jul  1 12:47:30 mb2-0_230-4 daemon.info pppd[3487]: Using interface ppp0
Jul  1 12:47:30 mb2-0_230-4 daemon.notice pppd[3487]: Connect: ppp0 <--> eth1
Jul  1 12:47:30 mb2-0_230-4 daemon.warn pppd[3487]: Couldn't increase MTU to 1500
Jul  1 12:47:30 mb2-0_230-4 daemon.warn pppd[3487]: Couldn't increase MRU to 1500
Jul  1 12:47:30 mb2-0_230-4 daemon.warn pppd[3487]: Couldn't increase MTU to 1500
Jul  1 12:47:30 mb2-0_230-4 daemon.warn pppd[3487]: Couldn't increase MRU to 1500
Jul  1 12:47:34 mb2-0_230-4 daemon.notice pppd[3487]: PAP authentication succeeded
Jul  1 12:47:34 mb2-0_230-4 daemon.notice pppd[3487]: PAP authentication succeeded
Jul  1 12:47:34 mb2-0_230-4 daemon.notice pppd[3487]: peer from calling number 00:90:XX:XX:XX:XX authorized
Jul  1 12:47:34 mb2-0_230-4 daemon.notice pppd[3487]: replacing old default route to br-ff [X.Y.17.35]
Jul  1 12:47:34 mb2-0_230-4 daemon.notice pppd[3487]: local  IP address 78.51.X.Y
Jul  1 12:47:34 mb2-0_230-4 daemon.notice pppd[3487]: remote IP address 213.191.64.48
Jul  1 12:47:34 mb2-0_230-4 daemon.notice pppd[3487]: primary   DNS address 213.191.74.11
Jul  1 12:47:34 mb2-0_230-4 daemon.notice pppd[3487]: secondary DNS address 213.191.92.82

AHHHHH!!! wink

So i asked me; is nobody using pppoe with kamikaze, or i do something wrong...?
any ideas, or can this fixes goes upstream?


nice regards
tetzlav

Hi,

the nic- is ok. Look at the source of rp-pppoe

/**********************************************************************
 * %FUNCTION: PPPoEDevnameHook
 * %ARGUMENTS:
 * cmd -- the command (actually, the device name
 * argv -- argument vector
 * doit -- if non-zero, set device name.  Otherwise, just check if possible
 * %RETURNS:
 * 1 if we will handle this device; 0 otherwise.
 * %DESCRIPTION:
 * Checks if name is a valid interface name; if so, returns 1.  Also
 * sets up devnam (string representation of device).
 ***********************************************************************/
static int
PPPoEDevnameHook(char *cmd, char **argv, int doit)
{
    int r = 1;
    int fd;
    struct ifreq ifr;

    /* Only do it if name is "ethXXX" or "brXXX" or what was specified
       by rp_pppoe_dev option (ugh). */
    /* Can also specify nic-XXXX in which case the nic- is stripped off. */
    if (!strncmp(cmd, "nic-", 4)) {
    cmd += 4;
    } else {
    if (strncmp(cmd, "eth", 3) &&
        strncmp(cmd, "br", 2)) {
        if (OldDevnameHook) return OldDevnameHook(cmd, argv, doit);
        return 0;
    }
    }
conmarti wrote:

the nic- is ok. Look at the source of rp-pppoe

Ah, k! wink

But the pre-up of physical device is necessary, or should this placed somewhere else (eg. /lib/network/config.sh)?


Regards
tetzlav

i don't know which version of kamikaze you're using. But on my router i run 7.09 and the interface eth1 is brought up by config.sh


root@OpenWrt:/lib/network# sh -x /sbin/ifup wan 2>&1 | grep ifconfig
sh -x /sbin/ifup wan 2>&1 | grep ifconfig
+ sh -x /sbin/ifup wan
+ grep ifconfig
+ ifconfig ppp0 0.0.0.0 down
+ ifconfig eth1 0.0.0.0 down
+ ifconfig eth1
+ ifconfig eth1 down
+ ifconfig eth1
+ ifconfig eth1 mtu 1492 up
conmarti wrote:

i don't know which version of kamikaze you're using. But on my router i run 7.09 and the interface eth1 is brought up by config.sh

Oh-Oh! :-( my fault...

I use this patch with Magicboxes to bring up the bridges with right MAC from option macaddr in /etc/config/network (because they all have the same hardcoded MAC on ethernet devices). So my problem was a odd side effekt... :-/

<edit>
My MAC-problem is:
the bridge is set up with orginal MAC of phy-interface (line: prepare_interface "$iface" "$config" || return 0), and _after_ that the optional hw ethers settings will be applied to the physical interface but _not_ to the bridge-if... :-/
I think the right place to apply the hw ether settings is in function prepare_interface() too...
</edit>

*sry for confusion*
tetzlav

(Last edited by tetzlav on 3 Jul 2008, 00:29)

The discussion might have continued from here.