Custom WAN_6 virtual interface suffix

After the pppoe dial-up is completed, the wan_6 virtual interface of the DHCPv6 protocol is generated through the /lib/netifd/ppp6-up. The DHCPv6 protocol has a Clientid or iFaceid parameter that can affect the suffix production method. How to customize this suffix? only add a code to /lib/netifd/ppp6-up?

Go Interfaces > WAN edit > Obtain IPv6 address (Manual)

Delete the wan_6 interface and create your own interface

The WAN_6 interface is the virtual interface created automatically after the PPPOE dial -up is completed. When the interface is automatically deleted, it is not created manually. Please note that there is a downward line in the middle of the WAN6 interface

You don't want to create your own ipv6 interface?

You didn't understand what I said. Maybe you can look at the process created by the WAN_6 virtual interface.

/lib/netifd/proto/ppp.sh

...
proto_run_command "$config" /usr/sbin/pppd \
                nodetach ipparam "$config" \
                ifname "$pppname" \
                ${localip:+$localip:} \
                ${lcp_failure:+lcp-echo-interval $lcp_interval lcp-echo-failure $lcp_failure $lcp_adap
                ${ipv6:++ipv6} \
                ${autoipv6:+set AUTOIPV6=1} \
                ${ip6table:+set IP6TABLE=$ip6table} \
                ${peerdns:+set PEERDNS=$peerdns} \
                nodefaultroute \
                usepeerdns \
                $demand $persist maxfail $maxfail \
                ${holdoff:+holdoff "$holdoff"} \
                ${username:+user "$username" password "$password"} \
                ${connect:+connect "$connect"} \
                ${disconnect:+disconnect "$disconnect"} \
                ip-up-script /lib/netifd/ppp-up \
                ipv6-up-script /lib/netifd/ppp6-up \
                ip-down-script /lib/netifd/ppp-down \
                ipv6-down-script /lib/netifd/ppp-down \
                ${mtu:+mtu $mtu mru $mtu} \
                "$@" $pppd_options
...

/lib/netifd/ppp6-up

...
if [ -n "$AUTOIPV6" ]; then
	ZONE=$(fw3 -q network $PPP_IPPARAM 2>/dev/null)

	json_init
	json_add_string name "${PPP_IPPARAM}_6"
	json_add_string ifname "@$PPP_IPPARAM"
	json_add_string proto "dhcpv6"
	[ -n "$ZONE" ] && json_add_string zone "$ZONE"
	[ -n "$EXTENDPREFIX" ] && json_add_string extendprefix 1
	[ -n "$IP6TABLE" ] && json_add_string ip6table $IP6TABLE
	[ -n "$PEERDNS" ] && json_add_boolean peerdns $PEERDNS
	json_close_object
	ubus call network add_dynamic "$(json_dump)"
fi
...

/lib/netifd/proto/dhcpv6.sh​

...
proto_export "INTERFACE=$config"
    proto_run_command "$config" odhcp6c \
        -s /lib/netifd/dhcpv6.script \
        $opts $iface
...

Rather that customizing the scripts, it is much easier to create manually the wan6 interface and add the desired clientid.

network.wan=interface
network.wan.device='eth1'
network.wan.proto='pppoe'
network.wan.username='someuser'
network.wan.metric='10'
network.wan.password='somepass'
network.wan.keepalive='6 10'
network.wan.ipv6='1'
network.wan.peerdns='0'

network.wan6=interface
network.wan6.proto='dhcpv6'
network.wan6.macaddr='aa:bb:cc:dd:ee:ff'
network.wan6.clientid='blahblah'
network.wan6.reqprefix='auto'
network.wan6.reqaddress='none'
network.wan6.device='@wan'
network.wan6.peerdns='0'
network.wan6.metric='512'
network.wan6.sourcefilter='1'
1 Like

The WAN6 interface is available for the initialization of the system. The WAN_6 interface is a virtual interface created by the system script after PPPOE dial! These are different two interfaces and the WAN6 interface cannot get the IPv6 address after the PPPOE dial-up is successful! The possible reason is that it is related to the IPv6-PD

Pay attention to what @viniribeirossa and I are telling you.
We both told you to disable the automatic creation of wan_6 and work your way with wan6.

Sorry, there was no understanding before:

  1. Did not check your code before, network.wan.ipv6 = '1' This is different;

  2. Official documentation (https://openwrt.org/docs/guide-user/network/wan_interface_protocols#protocol_pppoe_PPP_Over_ethered) ipv6 parameter 0,1, auto three values. Very simple, do not understand what the value represents;

Question: If the above code is modified to manual, will it affect the normal obtaining IPv6-PD in the local area network device?

It is explained in detail here
If you use the manual in luci or option ipv6 1 in uci then there is no wan_6 and you can configure wan6. Wan6 exists in default configuration.

1 Like

Thank you, I find time to try! Will this setting affect the acquisition of the LAN IPv6-PD?

No. The IPv6-PD is obtained via DHCPv6, which is done in @trendy's config.

The prefix that the ISP will delegate to you is controlled by them. But if they told you that the clientid is something that affects the delegated prefix, you can configure it on the wan interface and hopefully it will have the results you want.

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