netifd:Failed to bring up static 6rd tunnel after we modify 6rd tunnel from dynamic type to static
Username: Kai Song
Origin: https://bugs.openwrt.org/index.php?do=details&task_id=1581
Supply the following if possible:
-
Device problem occurs on
-
Software versions of OpenWrt/LEDE release, packages, etc.
netifd-0f96606b7040b8e14190ff055d5761744bc15f6d
- Steps to reproduce
Step 1: Create a DHCPv4 + dynamic 6rd wan connection. Below is the /etc/config/network. wan and wan6 go up after “/etc/init.d/network reload”
[CXNK00123457] /lib/netifd/proto # cat /etc/config/network
config interface 'loopback' option ifname 'lo' option proto 'static' option ipaddr '127.0.0.1' option netmask '255.0.0.0'
config globals 'globals' option ula_prefix 'auto'
config interface 'lan' option ifname 'eth0' option type 'bridge' option proto 'static' option ipaddr '192.168.1.1' option netmask '255.255.255.0' option ip6assign '64'
config interface 'pvtlan' option proto 'static' option ipaddr '169.254.1.1' option netmask '255.255.255.0'
config interface 'wan' option ifname 'eth1' option proto 'dhcp' option peerdns '1' option defaultroute '1' option vendorid '844Ei.ONT.dslforum.org' option reqopts '43 120 121' option iface6rd 'wan6'
Step 2: Edit /etc/config/network file, disable dynamic 6rd and provision a static one
[CXNK00123457] /etc/config # cat network.static6rd
config interface 'loopback' option ifname 'lo' option proto 'static' option ipaddr '127.0.0.1' option netmask '255.0.0.0'
config globals 'globals' option ula_prefix 'auto'
config interface 'lan' option ifname 'eth0' option type 'bridge' option proto 'static' option ipaddr '192.168.1.1' option netmask '255.255.255.0' option ip6assign '64'
config interface 'pvtlan' option proto 'static' option ipaddr '169.254.1.1' option netmask '255.255.255.0'
config interface 'wan' option ifname 'eth1' option proto 'dhcp' option peerdns '1' option defaultroute '1' option vendorid '844Ei.ONT.dslforum.org' option reqopts '43 120 121'
config interface 'wan6' option ifname 'eth1' option proto '6rd' option peerdns '0' option defaultroute '1' list dns '2001:db8:1::a' list dns '2001:db8:1::b' option tunlink 'wan' option peeraddr '10.101.1.1' option ip6prefix '2602::' option ip6prefixlen '32' option ip4prefixlen '24'
Step 3: Run “/etc/init.d/network reload”. However, netifd failed to bring up the static 6rd tunnel wan6.
Here is the log of netifd from /var/log/messages. From the log, it seems that netifd was trying to bring up wan6 before wan (DHCPv4) went up. See “netifd: Interface ‘wan6’ is setting up now”. Does this matter?
[CXNK00123457] /etc/config # /etc/init.d/network reload Wed Jun 6 06:26:25 2018 daemon.notice netifd: Interface 'wan6' has lost the connection Wed Jun 6 06:26:25 2018 daemon.warn dnsmasq[19262]: no servers found in /tmp/resolv.conf.auto, will retry Wed Jun 6 06:26:25 2018 daemon.notice netifd: tunnel '6rd-wan6' link is down Wed Jun 6 06:26:26 2018 daemon.notice netifd: Interface 'wan6' is now down Wed Jun 6 06:26:26 2018 daemon.notice netifd: Interface 'wan6' is setting up now Wed Jun 6 06:26:26 2018 daemon.notice netifd: wan (2641): Received SIGTERM Wed Jun 6 06:26:26 2018 daemon.notice netifd: Interface 'wan' is now down Wed Jun 6 06:26:26 2018 daemon.notice netifd: Interface 'wan' is disabled Wed Jun 6 06:26:26 2018 daemon.notice netifd: Interface 'wan' has link connectivity loss Wed Jun 6 06:26:26 2018 kern.info kernel: [119305.628866] 8021q: adding VLAN 0 to HW filter on device eth1 Wed Jun 6 06:26:26 2018 kern.info kernel: [119305.630319] IPv6: ADDRCONF(NETDEV_UP): eth1: link is not ready Wed Jun 6 06:26:26 2018 daemon.notice netifd: Interface 'wan' is enabled Wed Jun 6 06:26:27 2018 daemon.notice netifd: Interface 'wan6' is now down Wed Jun 6 06:26:28 2018 daemon.notice netifd: Network device 'eth1' link is up Wed Jun 6 06:26:28 2018 daemon.notice netifd: Interface 'wan' has link connectivity Wed Jun 6 06:26:28 2018 daemon.notice netifd: Interface 'wan' is setting up now Wed Jun 6 06:26:28 2018 kern.info kernel: [119307.631409] e1000: eth1 NIC Link is Up 1000 Mbps Full Duplex, Flow Control: RX Wed Jun 6 06:26:28 2018 kern.info kernel: [119307.632184] IPv6: ADDRCONF(NETDEV_CHANGE): eth1: link becomes ready Wed Jun 6 06:26:29 2018 daemon.notice netifd: wan (3351): udhcpc (v1.23.2) started =========== interface wan disconnected =========== Wed Jun 6 06:26:30 2018 daemon.notice netifd: wan (3351): Sending discover... Wed Jun 6 06:26:31 2018 daemon.notice netifd: wan (3351): Sending select for 10.101.1.100... Wed Jun 6 06:26:31 2018 daemon.notice netifd: wan (3351): Lease of 10.101.1.100 obtained, lease time 503 Wed Jun 6 06:26:31 2018 daemon.notice netifd: Interface 'wan' is now up Wed Jun 6 06:26:31 2018 daemon.info dnsmasq[19262]: reading /tmp/resolv.conf.auto Wed Jun 6 06:26:31 2018 daemon.info dnsmasq[19262]: using local addresses only for domain lan Wed Jun 6 06:26:31 2018 daemon.info dnsmasq[19262]: using nameserver 10.101.0.1#53 =========== interface wan connected =========== Wed Jun 6 06:26:31 2018 daemon.notice netifd: wan (3351): rgcommon>sys update-interface-status wan Wed Jun 6 06:26:32 2018 user.notice firewall: Reloading firewall due to ifup of wan (eth1)