How to PPPoE Relay/Passthrough?

Hello,

For some reason I need to connect via PPPoE with the ONT/ONU at the secondary OpenWrt router to get the public internet IP address directly.

Network structure: ONT/ONU -> primary OpenWrt router -> secondary OpenWrt router

How do I make the primary OpenWrt router support PPPoE Relay/Passthrough in OpenWrt 23.05?

Or does this mean that the secondary OpenWrt router needs to communicate directly with the ONT/ONU via the primary OpenWrt router?

I know there was some answer on the forum, but it doesn't work for OpenWrt 23.05 because there is no pppoe-relay package anymore.

Best regards,
Gentry

The most straightforward way to do this is to run VLANs on the Ethernet cable between the two routers. The first router then operates only as an Ethernet switch, its software doesn't interact with the pppoe packets at all.

3 Likes

Okay, I'm trying to understand what you mean.

Currently I added the WAN port eth1 to the br-lan bridge and created two VLANs.

Assuming that lan1 is connected to the secondary router, is my configuration correct?

-: Not Member
T: Tagged
U: Untagged

Or should I create a new network bridge and put the eth1 and lan1 directly together?

Sorry, I don't quite understand how this works here.

You can create a dedicated bridge for this. Do you need secondary router to be on the same LAN as the primary? Or only relay the PPPoE link?

If possible, I would still like to have normal LAN communication between the two routers, such as if I have an internal Samba service.

That's quite doable. Create a bridge and add the WAN port and the LAN port going to the secondary router. That take cares of the PPPoE relay, on the secondary router you can plug the cable to the WAN port and configure PPPoE as usual.

As for LAN, create a VLAN (802.1q) device, with the Base device being the same port that connects to secondary router. On br-lan, add this new device to the bridge. On the secondary router, similarly create VLAN, but this time of course with WAN port as the Base device and just as in primary, add it to br-lan.

Side note: I trust you know how to manage DHCP as you're bridging LAN between the two routers.

1 Like

Ok thank you very much for your help my friend.

I will try it.

Would this technique make it possible to provide IP passthrough on my Zyxel NR7101 such that my downstream router receives the wan IP?

I'd imagine so. What's your setup like? As long as you bridge ports but don't attach it to any interface, you're basically creating a dumb switch all the way to whatever device decides to attach an actual interface to it.

No. The problem is that your primary router will attempt a DHCP transaction because there is no way to disable the automatic creation of a virtual DHCP interface.

Also, the vendor firmware that supports IP passthrough has a trick that has no equivalent in OpenWrt: on reconnection, they temporary drop the carrier on the LAN port, so that the downstream router sees it as a cable replug event.

I like to think there might be a way in OpenWrt or at least some interest in implementing this one day - IP passthrough is a very commonly wanted feature, as for automatic reconnection. Perhaps I should make a feature request post about it.

Ah yes, interesting - my Huawei B818-263 did that, and I wrote a little script for my downstream router running Asus Merlin to handle this:

#!/bin/sh

renew_wan_lease=0

ip monitor link dev eth0 | while read event; do
	
	# logger "maintain-wan-lease detected eth0 event: "$event

	case $event in

	*'NO-CARRIER'* )
		if [ $renew_wan_lease -eq 0 ]; then
			logger "maintain-wan-lease detected eth0 state change to: 'NO-CARRIER', so forcing udhcpc to release wan lease."
			killall -SIGUSR2 udhcpc
			renew_wan_lease=1		
		fi
	;;

	*'LOWER_UP'* )
		if [ $renew_wan_lease -eq 1 ]; then
			logger "maintain-wan-lease detected eth0 state change from: 'NO-CARRIER' to: 'LOWER_UP', so forcing udhcpc to renew wan lease."
			killall -SIGUSR1 udhcpc
			renew_wan_lease=0
		fi
	;;
	esac

done

What do you mean? If you attach a port to a bridge and don't have it connect to any interface, OpenWrt won't do anything with the interface at all. Only when you attach it to interface, enable DHCP client configuration will it attempt a DHCP transaction. Or you can simply attach it to an interface and leave it in an unconfigured state, it won't do anything with it but you can enable DHCPC if needed in the future.

At most, the bridge will act as an L2 device, effectively a dumb switch, no L3 functionality at all.

What's the significance of this:

root@OpenWrt-0:~# cat /sys/class/net/wwan0/qmi/
add_mux       del_mux       pass_through  raw_ip
root@OpenWrt-0:~# cat /sys/class/net/wwan0/qmi/pass_through
N

If I merely attach the wwan0 port to a bridge, there is nothing that will set the APN and bring the cellular data path up. This is a task for uqmi or ModemManager, but if installed in OpenWrt, they will automatically start the DHCP transaction, because nobody envisioned the use case where the DHCP transaction is supposed to be started by some other host via a bridge.

Ah, if cellular is involved, I've no idea. I'll see myself out.

This is definitely not relevant. The 802.3 mode is what adds Ethernet headers, thus allowing the device to be put in the bridge.

BTW, this sounds like an USB device. Have you considered USB over IP thing? Is that even relevant/maintained any more?

Document seems very outdated, but I don't know. Also, it doesn't have USB over IP client set up for OWrt, but it's a lead you may find interesting if your device indeed is USB.

Thanks that's very interesting. I really appreciate your input here, especially since I'm aware we're straying a bit. I believe in the NR7101 the modem is connected via USB 3.0 to a switch with a driver that isn't as performant as the OEM one, and this gives a huge speed bottleneck compared to OEM firmware. The NR7101 passes this through to ethernet and to my downstream router. But my understanding of these matters isn't as good as @patrakov's, and I may well be talking through my hat.

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.