Setup WAN connection with PPPoE and dual-stack

I am going to put my ISP router to bridge mode, and use a OpenWrt one to replace it. My ISP supports dual-stack IPv4 + IPv6. The current configuration that I do on their router is to create an interface from the VID11 (with the VID12 being the connection for IPTV). Once the interface is created, all I need to do is entering the PPPoE username + password for that interface, then it is all good.

Assume that the VID11 interface is created and bridged to the switch, and I plug a cable from one of the switch port to OpenWrt's WAN port. Which configuration should I change to make it work? Now it is still default:

config interface 'wan'
	option ifname 'eth0.2'
	option proto 'dhcp'

config device 'wan_dev'
	option name 'eth0.2'
	option macaddr '20:76:93:46:64:50'

config interface 'wan6'
	option ifname 'eth0.2'
	option proto 'dhcpv6'

I am not really sure because there are both wan and wan6 interfaces. Maybe the MAC address needs to be duplicated from the old router, too.

You can create a new vlan 11 on the switch and use that one on the wan port. You might need to keep it tagged on the wan physical port.
wan6 can point to wan by using @wan in ifname.
Be careful with MAC duplication, not to have conflict with the modem.

The ISP router, by default, output untagged Ethernet frames on its switch ports. VLAN job is done transparently on the ISP router, so generally the OpenWrt router does not need to care about it. So, I should change the config to:

config interface 'wan'
	option ifname 'eth0.2'
	option proto 'pppoe'
	option username  'my-user-name'
	option password  'my-password'

config interface 'wan6'
	option ifname '@wan'
	option proto 'dhcpv6'

Is that correct?

You also need option ipv6 1 in the wan section.
If you think that .1q tagging is still done in bridge mode of the router, then keep it like this.
Otherwise you'd need to change ifname to eth0.11 and tag it.

I tried changing wan interface to PPPoE with username and password, without touching wan6. And everything seems fine -- I got an IPv6 address, and can ping to IPv6 websites.

It is kinda weird. The wan6 protocol is still left as dhcpv6. I never expect it to work like that.

pppoe can get a SLAAC (and Link Locan of course), but for the LAN part to get a prefix delegated DHCPv6 is a must.

By configuring wan interface as PPPoE as above, I can no longer access the ISP router (192.168.1.1) from behind the OpenWrt (192.168.100.0/24), even if I added a static route to 192.168.1.0/24 to OpenWrt's wan interface.

Now I leave wan interface intact, and try PPPoE on the wan6 interface:

config interface 'wan'
	option ifname 'eth0.2'
	option proto 'dhcp'

config interface 'wan6'
	option ifname 'eth0.2'
	option proto 'pppoe'
	option 'username'  'my-account'
	option 'password'  'my-password'

The result is out of my expectation as well. A new interface namely wan6_6 is created automatically. And I can access the ISP router via the original wan interface.


It looks like exactly what I want to do. But I still need some explanation how and why it works like that. It is interesteing to know that we can create multiple virtual interfaces (wan with DHCP and wan6 with PPPoE) working on a single virtual interface (eth0.2).

Making it work is not important. What is important is we know how it works. Because once we know how it works, we can always make it works and fix it when it stops working. :slight_smile:

The xxx_6 interface is automatically spawned by the PPPoE protocol handler if IPv6 is offered by the PPP peer. Since you configured wan6 to be a PPPoE interface, the resulting virtual interface is called wan6_6.

I would suggest the following setup:

  • Configure wan to do PPPoE
  • Delete wan6 since it is not required in your case, it serves as fallback for other WAN configuration protocols
  • Declare a new modem interface
    • Set its protocol to DHCP
    • Set its physical interface to eth0.2
    • Set default route and DNS to ignore (option defaultroute 0, option peerdns 0)

The addtional modem interface will then take care of obtaining an 192.168.x.x IP from your modem but it will not interfere with the normal internet routing and DNS setup.

1 Like

https://openwrt.org/docs/guide-user/network/wan/access.modem.through.nat

1 Like

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