[OpenWrt-Devel] netifd: handling of interfaces with proto "none"

Jo-Philipp Wich jow at openwrt.org
Mon Jun 8 04:17:06 EDT 2015

Hi Lars,

I struggled with this issue as well and after a brief chat with nbd the 
conclusion was to force the tap device to be "external", this will cause
netifd to leave its routes and address config alone, even when ifup is 
called on the network.

In short you need to prepare the vpn interface without any ifname option,
using something like that:

  # prepare network if not existing yet
  if ! uci -q get network.${netname}; then
    uci set network.${netname}=interface
    uci set network.${netname}.proto=none
    ubus call network reload

  # externally attach netdev
  ubus call network.interface.${netname} add_device '{ "name": "'$ifname'" }'

If you then call "ifstatus" on $netname you should see "device" and
"l3_device" pointing to "$ifname". Calling "devstatus" on $ifname should
display "external: true".

openwrt-devel mailing list
openwrt-devel at lists.openwrt.org

More information about the openwrt-devel mailing list