On Tuesday 08 November 2016 22:05:52 Gui Iribarren wrote:
Hey friends,
I've just stumbled this situation "in the wild" (a friend who tried
libremesh on two routers and got stuck, then asked me to have a look inside)
steps to reproduce:
1. router A, freshly flash with 16.07 from
downloads.lime.org
2. connect router A via WAN to the internet
3. watchping detects the connection and executes
bmx6 -c tunOut -inet4 && bmx6 -c tunIn inet4 /n 0.0.0.0/0
4. now go via luci interface and set, for example, hostname or whatever
5. "save & apply" triggers a "uci commit"
6. there are "pending changes" in bmx6 uci, which get commited as well
-bmx6.inet4
bmx6.cfg1020b3='tunIn'
bmx6.cfg1020b3.tunIn='inet4'
bmx6.cfg1020b3.network='0.0.0.0/0'
7. disconnect WAN internet and reboot
now flash another router B, connect router B via WAN to Internet, and
try to access that connection from router A (router A not connected
anymore directly to WAN)
router A doesn't have the inet4 tunOut anymore, and actually publishes a
"blackhole" tunIn 0.0.0.0/0
and it will stay in that broken state forever (unless, well, you
"firstboot" it or something)
In first place it seems quirky that they have set the hostname after connecting
to WAN, and then after saving WAN is lost...
BTW reality is always quirky...
a "proper" fix would be for bmx6 to not
necesarily write runtime config
changes to /tmp/.uci/bmx6 (say, have an option)
a quick dirty workaround that comes off the top of my head would be to
issue a "uci revert bmx6" at the end of
/etc/watchping/wan-fail.d/bmx6-gw
/etc/watchping/wan-ok.d/bmx6-gw
If the UCI section being created in not anonymous we could delete just that
section without interfering with other configurations that may have been
created by other components
Cheers!