Network device in not present

Make sure that IPv6 gateway is set on inteface wan.

Here are some useful notes I got while I was strugged with this issue.

Error: Network device is not present seems to come from dslite.sh.

See: https://github.com/openwrt/openwrt/blob/1e4469b090a7e3234345c1b7f17c956ec7dc0b81/package/network/ipv6/ds-lite/files/dslite.sh#L27

This file is deployed at /lib/netifd/proto/dslite.sh inside openwrt.

In some cases proto_add_host_dependency will return exit code 4 (UBUS_STATUS_NOT_FOUND).
And shell script seems to be terminated then.

We can observe this behavior by modifying shell script like following:

	( proto_add_host_dependency "$cfg" "::" "$tunlink" && logger ok || logger err $? )

Note that it needs restart of /sbin/netifd process, when we change dslite.sh and needs to reflected correctly.
This will help: service network restart

The log can be seen from either:

  • OpenWrt: StatusSystem Log
  • Shell: logread | grep "user.notice root:"

proto_add_host_dependency seems to be used to propagate ifdown/up events coming from underlying iface (like wan).
e.g. whenever wan is restarted, dslite is also restarted.

See also: https://openwrt.org/docs/guide-developer/network-scripting

	( proto_add_host_dependency "$cfg" "::" "$tunlink" )

The 2nd arg "::" seems to indicate "find the interface having IPv6 default gateway".

Although dslite is usually activated on valid IPv6 enabled network, sometimes we build easy sandbox for testing purpose.

Thus changing from "::" to "" will skip checking of default gateway.