[Solved] Retain WAN protocols settings when switching protocol

Not sure if this is the best place for this post, so apologies if it isn't.

In situation where a user has more than one router, and they would like to rearrange them (e.g. change which is the main router etc), it would be useful that WAN settings for the different protocols are retained. Currently if I have WAN of a particular router set to PPPoE with ISP credentials and settings there, I change it to DHCP client then I want to change back to PPPoE, I have to fill in the settings again.

It's probably not much trouble to do so, but it would make sense if the settings for each protocol are retained. It would make it a bit easier for people when they are trying different configurations to find the optimum.

If you edit the config files by hand in /etc/config, you can easily retain all the settings you want.

1 Like

Thanks. Will do that.

It would be awesome if LuCI can do it :slight_smile:

You could just back you entire config and restore it when needed

I get it. Looking at etc\config\network I understand now why it doesn't happen.

Though, I would imagine a more flexible design for config would be something like the following:

config protocol 'wan_pppoe'
option username 'xyzabc'
option password 'gshdhs'
option ipv6 'auto'
option mtu '1420'

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

I don't know how feasible this is, but it just makes sense to me.

You could simply declare multiple wan interfaces sharing the same physical devices and only enable the needed interfaces.

uci set network.wan_static.disabled="1"
uci set network.wan_dynamic.disabled="0"
service network reload

Yeah, now that makes perfect sense. Thanks @jow and @vgaetera.

Put all the interface section in config/network in comments and restart the service. Now you can go to create a new interface in Luci. Just use a slightly different name, or the original will be overwritten.

1 Like

OK thanks.

Just so that I am sure, the default settings for OpenWrt gives me WAN and WAN6 interfaces. These matter only if I set them as IP client, but for PPPoE, only one of them is needed, right?

If you set WAN as pppoe and enable ipv6, then there should be a WAN_6 automatically created.
At least that is the case in my router.

1 Like

Did that, after restarting the service, the commented lines were gone!

Anyway, I will just enable or disable them as I need. Thanks.

You can't keep comments, if you overwrite the config via LuCI or command-line UCI.


I opened the file using WinSCP. It opens it in the default text editor and saves back to the original file.

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