OpenWrt Forum Archive

Topic: PPPoE over DHCP Help me!

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

Help set up PPPOE over DH?P. The so-called Russian PPPOE or Dual access on the OpenWrt x86 Kamikaze (r18961)

(Last edited by bulbet on 13 Mar 2011, 14:09)

there is a similar problem, one guy try to set up both dhcp and pppoe at the same time, you can search this in the forum, it's somewhat like change the configuration in the /etc/config/network.

I am afraid that this functionality apears in OpenWrt just in time for the ISP's install managed switches, and this in fact will not be needed.
nevertheless my solution is:

1. /etc/config/network
declared "abstaract" wan2 network force Openwrt to use it the process of constructing firewall rules.

#### WAN configuration
config interface        wan
        option ifname   eth0.1
        option proto    dhcp
        option macaddr  XXXXXXXXXXXX
        option hostname krey
        option reqopts  'staticroutes msstaticroutes'

config interface wan2
        option proto    none
        option ifname   ppp0
        option username MYNAME
        option password MYPASSWORD

2. Go up iface by hotplug event
create file  /etc/hotplug.d/iface/30-setup-pppoe and chmod +x to them

#!/bin/sh
[ "$INTERFACE" = wan ] && {
        [ "$ACTION" = ifup ] && /usr/sbin/pppd plugin rp-pppoe.so mtu 1492 mru 1492 eth0.1 persist usepeerdns defaultroute replacedefaultroute user $(uci get network.wan2.username) password  $(uci get network.wan2.password)
        [ "$ACTION" = ifdown ] && kill `ps | grep rp-pppoe | grep plugin | awk '{print $1}'`
}

3. Add wan2 to wan zone

config zone
        option name             wan
        option network  "wan wan2"
        option input    REJECT
        option output   ACCEPT
        option forward  REJECT
        option masq             1
        option mtu_fix  1

4. reboot

PS: Backfire trunk 26126, Asus RT-N16 (BIG thanks George)
PPS: ????????? ?? ??? ???????? ??????

(Last edited by Krey on 18 May 2011, 22:13)

Yeah this configuration looks quite reasonable but how about the routing table? What does the wan interface actually do? Should we change the default metric of the wan interface?

The routing table usually is received from ISP by dhcp. That's why staticroutes option is there. No need to change metric.
Default route is thru pppoe, local resources thru local gw assigned by dhcp.

Same way to configure PPTP or L2TP dual access.

fyi wrote:

Yeah this configuration looks quite reasonable but how about the routing table? What does the wan interface actually do? Should we change the default metric of the wan interface?

The wan interface is used for local recources DC++, ftp, forums, iptv, etc.

The reason to use it is that traffic thru wan is free. Or has no speed limit.

(Last edited by Pilot6 on 19 May 2011, 15:01)

fyi wrote:

What does the wan interface actually do? Should we change the default metric of the wan interface?

Pilot6 absolutely right. Looks my routing table (generaly received from ISP)

root@OpenWrt:~# route
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
77.50.1.58      *               255.255.255.255 UH    0      0        0 ppp0
78.153.132.128  10.9.127.1      255.255.255.128 UG    0      0        0 eth0.1
213.148.27.0    10.9.127.1      255.255.255.0   UG    0      0        0 eth0.1
89.222.132.0    10.9.127.1      255.255.255.0   UG    0      0        0 eth0.1
78.153.130.0    10.9.127.1      255.255.255.0   UG    0      0        0 eth0.1
82.148.15.0     10.9.127.1      255.255.255.0   UG    0      0        0 eth0.1
10.9.127.0      *               255.255.255.0   U     0      0        0 eth0.1
78.153.144.0    10.9.127.1      255.255.255.0   UG    0      0        0 eth0.1
78.153.134.0    10.9.127.1      255.255.255.0   UG    0      0        0 eth0.1
78.153.141.0    10.9.127.1      255.255.255.0   UG    0      0        0 eth0.1
192.168.156.0   *               255.255.255.0   U     0      0        0 br-lan
78.153.128.0    10.9.127.1      255.255.254.0   UG    0      0        0 eth0.1
91.204.128.0    10.9.127.1      255.255.252.0   UG    0      0        0 eth0.1
213.148.16.0    10.9.127.1      255.255.252.0   UG    0      0        0 eth0.1
192.168.16.0    10.9.127.1      255.255.248.0   UG    0      0        0 eth0.1
94.141.160.0    10.9.127.1      255.255.224.0   UG    0      0        0 eth0.1
77.50.0.0       10.9.127.1      255.255.0.0     UG    0      0        0 eth0.1
172.16.0.0      10.9.127.1      255.240.0.0     UG    0      0        0 eth0.1
10.0.0.0        10.9.127.1      255.0.0.0       UG    0      0        0 eth0.1
default         pppoe-gw.net.st 0.0.0.0         UG    0      0        0 ppp0

Hello.Help me please.I Configured Dual Access as you show.Internet working only on my router . on PC and notebook no internet.Maybe firewall do not accept out pppoe.


default routes without Dual access
root@OpenWrt:~# route
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
172.16.0.1      *               255.255.255.255 UH    0      0        0 pppoe-wan
192.168.1.0     *               255.255.255.0   U     0      0        0 br-lan
default         172.16.0.1      0.0.0.0         UG    0      0        0 pppoe-wan


with dual Access
root@OpenWrt:~# route
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
172.16.0.1      *               255.255.255.255 UH    0      0        0 ppp0
192.168.1.0     *               255.255.255.0   U     0      0        0 br-lan
172.16.0.0      *               255.255.0.0     U     0      0        0 eth1
default         172.16.0.1      0.0.0.0         UG    0      0        0 ppp0

(Last edited by RAID on 5 Dec 2011, 21:35)

Execute "uci export network ; uci export firewall".

config 'interface' 'loopback'
        option 'ifname' 'lo'
        option 'proto' 'static'
        option 'ipaddr' '127.0.0.1'
        option 'netmask' '255.0.0.0'

config 'interface' 'lan'
        option 'ifname' 'eth0'
        option 'type' 'bridge'
        option 'proto' 'static'
        option 'ipaddr' '192.168.1.1'
        option 'netmask' '255.255.255.0'

config 'interface' 'wan'
        option 'ifname' 'eth1'
        option 'proto' 'dhcp'

config 'interface' 'wan2'
        option 'ifname' 'pppoe'
        option 'proto' 'none'
        option 'username' ' my username'
        option 'password' ' my pass'

config 'switch' 'eth0'
        option 'enable_vlan' '1'

config 'switch_vlan'
        option 'device' 'eth0'
        option 'vlan' '1'
        option 'ports' '0 1 2 3 4'





config 'defaults'
        option 'syn_flood' '1'
        option 'input' 'ACCEPT'
        option 'output' 'ACCEPT'
        option 'forward' 'REJECT'

config 'zone'
        option 'name' 'lan'
        option 'network' 'lan'
        option 'input' 'ACCEPT'
        option 'output' 'ACCEPT'
        option 'forward' 'REJECT'

config 'zone'
        option 'name' 'wan'
        option 'network' 'wan wan2'
        option 'input' 'REJECT'
        option 'output' 'ACCEPT'
        option 'forward' 'REJECT'
        option 'masq' '1'
        option 'mtu_fix' '1'

config 'forwarding'
        option 'src' 'lan'
        option 'dest' 'wan'

config 'rule'
        option 'src' 'wan'
        option 'proto' 'udp'
        option 'dest_port' '68'
        option 'target' 'ACCEPT'
        option 'family' 'ipv4'

config 'rule'
        option 'src' 'wan'
        option 'proto' 'icmp'
        option 'icmp_type' 'echo-request'
        option 'target' 'ACCEPT'

PS My Win7 show that internet connection is allright. on PC and notebook. but no success ping tracrt and etc on internet

(Last edited by RAID on 6 Dec 2011, 22:26)

config 'interface' 'lan'
        option 'ifname' 'eth0.1'
        option 'type' 'bridge'
        option 'proto' 'static'
        option 'ipaddr' '192.168.1.1'
        option 'netmask' '255.255.255.0'

-------- 8< --------

config 'switch' 'eth0'
        option 'enable_vlan' '1'

config 'switch_vlan'
        option 'device' 'eth0'
        option 'vlan' '1'
        option 'ports' '0 1 2 3 4'

Which router is it?

I`m not exactly understand what do you mean. Find mistake in firewall
with dual access in iptables in all tables filter nat prerouting used interface eth1
without dual access   in all tables (in/out)  used pppoe
how can i fix it ?

RAID wrote:

Hello.Help me please.I Configured Dual Access as you show.Internet working only on my router . on PC and notebook no internet.

There's no problem with wan. I think the problem is the ifname of lan interface, eth0 vs. eth0.1. That's why I asked which router it is.

Lan interface have name eth0
Wan interface have name eth1

no success.I try to set Lan name eth0.1  ((((((( no changes

(Last edited by RAID on 8 Dec 2011, 21:26)

Which router is it?

D-link DIR-615 e4

Router ModelD-Link DIR-600 rev. A1
        Firmware Version
OpenWrt Backfire 10.03.1-rc5 /LuCI 0.10 Branch 0.10+svn7292

(Last edited by RAID on 9 Dec 2011, 08:25)

I`m downloading and flashing exactly this firmware  smile

(Last edited by RAID on 9 Dec 2011, 17:00)

config 'interface' 'lan'
        option 'ifname' 'eth0'
        option 'type' 'bridge'
        option 'proto' 'static'
        option 'ipaddr' '192.168.1.1'
        option 'netmask' '255.255.255.0'

-------- 8< --------

config 'interface' 'wan2'
        option 'ifname' 'ppp0'
        option 'proto' 'none'
        option 'username' ' my username'
        option 'password' ' my pass'

-------- 8< --------

config 'switch' 'eth0'
        option 'enable_vlan' '1'
        option 'enable' '1'
        option 'reset' '1'

Krey wrote:
#### WAN configuration
config interface        wan
        option ifname   eth0.1
        option proto    dhcp
        option macaddr  XXXXXXXXXXXX
        option hostname krey
        option reqopts  'staticroutes msstaticroutes'

config interface wan2
        option proto    none
        option ifname   ppp0
        option username MYNAME
        option password MYPASSWORD

Actually I think it will be much easier to run the traditional way.

#### WAN configuration
config interface    wan
    option ifname   eth0.1
    option proto    dhcp
    option macaddr  XXXXXXXXXXXX
    option hostname krey
    option reqopts  'staticroutes msstaticroutes'

config interface    wan2
    option ifname   eth0.1
    option proto    pppoe
    option keepalive 3
    option username MYNAME
    option password MYPASSWORD

/etc/rc.local

# Put your custom commands here that should be executed once
# the system init finished. By default this file does nothing.

ifup wan2
exit 0

Add wan2 to wan zone.

config zone
    option name     wan
    option network  "wan wan2"
    option input    REJECT
    option output   ACCEPT
    option forward  REJECT
    option masq     1
    option mtu_fix  1

No hotplug is needed.

Local only DSL | Tumbleweed Rants

fyi wrote:

Actually I think it will be much easier to run the traditional way...

Btw, it can't be done with Luci, Only by manually editing config files or using uci command line tool, isn't it?  Luci doesn't allow use ifname 'eth0.1' twice.

secondly, i'm trying to use static routes:

network.@route[0]=route
network.@route[0].interface=wan
network.@route[0].target=xx.xx.xx.0
network.@route[0].gateway=10.xx.xx.1

but, after starting wan2 interface, routes are:

 Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
10.yy.yy.yyy      *               255.255.255.255 UH    0      0        0 pppoe-wan2
192.168.1.0     *               255.255.255.0   U     0      0        0 br-lan
default         10.yy.yy.yyy      0.0.0.0         UG    0      0        0 pppoe-wan2

Can you explain this? Thank you.

a005 wrote:

Btw, it can't be done with Luci, Only by manually editing config files or using uci command line tool, isn't it?  Luci doesn't allow use ifname 'eth0.1' twice.

#### WAN configuration
config interface    wan
    option ifname   eth0.1
    option type     bridge
    option proto    dhcp
    option macaddr  XXXXXXXXXXXX
    option hostname krey
    option reqopts  'staticroutes msstaticroutes'

config interface    wan2
    option ifname   br-wan
    option proto    pppoe
    option keepalive 3
    option username MYNAME
    option password MYPASSWORD

no success with your purpose Fyi ((((

RAID wrote:

no success with your purpose Fyi ((((

Yeah. I forgot to mention that after "ifup wan2", the ip address of interface "wan" is cleared because they share the same device, eth0.1. You just have to restore its ip address and netmask. So there's no need to set the type of interface "wan" as bridge.

/etc/rc.local

# Put your custom commands here that should be executed once
# the system init finished. By default this file does nothing.

ifup wan2
udhcpc -b -i eth0.1 #udhcpc -b -i br-wan
exit 0

The side effect is that since udhcpc is executed last, it might change the ip addresses of default gateway, dns server, etc. This is not good.

# Put your custom commands here that should be executed once
# the system init finished. By default this file does nothing.

#ifup wan2
#for x in $(pidof pppd); do tr '\0' ' ' < /proc/$x/cmdline; echo; done
/usr/sbin/pppd plugin rp-pppoe.so mtu 1492 mru 1492 persist usepeerdns defaultroute replacedefaultroute user MYNAME password MYPASSWORD ipparam wan2 ifname pppoe-wan2 nodetach nic-eth0.1
exit 0

#2781 (WAN interface fails to start on boot, manual 'ifup wan' needed) – OpenWrt