Hi
I'm trying batman-adv on openwrt on tp-link hardware. Some month ago, there were some bugs in the ar71xx adhoc mode which now seem resolved. I could setup a 2 node mesh test with batman-adv quite easily. One node is a gateway, the other is a repeater. The gateway has coova-chilli and 2 networks exported with batman-adv: the private and the public network. Both networks are bridged to batman-adv vlans, ethernet ports and wifi ssids. The repeater doesn't have coova-chilli, but bridge both networks to the wifi ssid and ethernet ports. But I would like to automate deployment with a single firmware, and need to auto-detect if the internet come from the WAN port or not.
The problem is that if I bridge the wan port, I can't use hotplug.d/iface feature because the whole bridge is declared up wether or not the internet port is connected.
Should I unconfigure the bridges first, then detect if internet works, then connect the bridge to batman?
Anyone have an idea on how I could do this?
Thanks
The problem is that if I bridge the wan port, I can't use hotplug.d/iface feature because the whole bridge is declared up wether or not the internet port is connected.
Hey Sophana, Don't bridge the wan, as you won't be able to route then.
Anyone have an idea on how I could do this?
we solved that "missing piece" with a few scripts
https://bitbucket.org/guidoi/batmesh/src/tip/packages/batman-adv-auto-gw-mod... https://bitbucket.org/guidoi/batmesh/src/tip/packages/watchping
Disclaimer (?) watchping suffers some race conditions in corner cases (watching on usb interfaces that take long to be detected at boot time, sometimes fails), and <wishlist> the hook environment could definitely be improved by some bash loving geek.</wishlist> On the other hand, i don't think batman-adv-auto-gw-mode could get any simpler than currently is. (since it offloads the work to watchping)
All in all, they work well, we've been using them on 4 different networks for the past 6 months, with no major hiccups.
you can add the repo as a feed to your openwrt build environment, $ grep batmesh feeds.conf src-hg batmesh https://bitbucket.org/guidoi/batmesh
and compile them yourself.
Given that it's all posix ash (no binaries), you can probably grab our precompiled packages as well. http://openwrt.altermundi.net/snapshots/current/ar71xx/packages/batman-adv-a... http://openwrt.altermundi.net/snapshots/current/ar71xx/packages/watchping_1....
if you give them a try , any feedback will be appreciated!
Cheers,
Gui
pd. Note that you need a relatively recent openwrt build , since it depends on netifd. If you're still on backfire, you can dig the repo for rev be69dc644a4b , it's a hacky no-netifd version
On Mon, Oct 15, 2012 at 12:33 PM, Gui Iribarren gui@altermundi.net wrote:
Given that it's all posix ash (no binaries), you can probably grab our precompiled packages as well.
Ooops.. broken link. Sorry, here's the current one: http://openwrt.altermundi.net/snapshots/current/ar71xx/packages/batman-adv-a... http://openwrt.altermundi.net/snapshots/current/ar71xx/packages/watchping_1....
On Mon, Oct 15, 2012 at 5:33 PM, Gui Iribarren gui@altermundi.net wrote:
Hey Sophana, Don't bridge the wan, as you won't be able to route then.
I would like to explicitely bridge the wan, as it is the private network. Just like a transparent wifi access point would do. Routing is not always what you want if you connect to your private LAN.
we solved that "missing piece" with a few scripts
https://bitbucket.org/guidoi/batmesh/src/tip/packages/batman-adv-auto-gw-mod... https://bitbucket.org/guidoi/batmesh/src/tip/packages/watchping
Thanks a lot for sharing your code. I took some time to understand how it works. If I understand correctly, you are using the batman-adv gateway feature. watchping is a script that simply uses ping on a specific interface to determine wether you are connected to the internet. When connected, you launch a dhcp server. When not, you launch a dhcp client.
Using dhcp means that you are routed.
As I would like to be bridged, this looks like it is not really a solution for me. The only solution I see is to start with the wan not bridged, test internet connection for a certain amount of time, then definitively decide if we are gateway or not.
When you are bridged, is there is solution to ping only the WAN port?
I still have to test your solution. Do I have to install all the batmesh packages? It seems that the whole configuration is made in batmesh-autoconf? Too bad you don't have all default ar71xx router images ready to flash.
On Tue, Oct 16, 2012 at 4:18 PM, Sophana K sophana78@gmail.com wrote:
On Mon, Oct 15, 2012 at 5:33 PM, Gui Iribarren gui@altermundi.net wrote:
Hey Sophana, Don't bridge the wan, as you won't be able to route then.
I would like to explicitely bridge the wan, as it is the private network. Just like a transparent wifi access point would do. Routing is not always what you want if you connect to your private LAN.
i think i don't fully understand your setup. could you care to describe it a little bit further?
we solved that "missing piece" with a few scripts
https://bitbucket.org/guidoi/batmesh/src/tip/packages/batman-adv-auto-gw-mod... https://bitbucket.org/guidoi/batmesh/src/tip/packages/watchping
Thanks a lot for sharing your code. I took some time to understand how it works. If I understand correctly, you are using the batman-adv gateway feature. watchping is a script that simply uses ping on a specific interface to determine wether you are connected to the internet. When connected, you launch a dhcp server. When not, you launch a dhcp client.
Correct. watchping takes care of pinging and running hooks based on result. batman-adv-auto-gw-mode is one of such hooks, that launchs a dhcp server + gw_mode=server when called in "wan success" (and undoes those actions when called in "wan failed")
Using dhcp means that you are routed.
As I would like to be bridged, this looks like it is not really a solution for me.
batman-adv gw_mode makes most sense in a routed situation, AFAIU
The only solution I see is to start with the wan not bridged, test internet connection for a certain amount of time, then definitively decide if we are gateway or not.
Why not leave it bridged from the start? as said previously, i probably don't understand your setup.
I still have to test your solution. Do I have to install all the batmesh packages?
Nope, they are meant to be independent. They just sit on the same repo for now.
It seems that the whole configuration is made in batmesh-autoconf?
batmesh-autoconf takes care of setting ipv4 on lan interface, creating adhoc vifs in wlan0/1/2 and adding them to bat0. If you do that manually or otherwise, no need of using batmesh-autoconf :)
Too bad you don't have all default ar71xx router images ready to flash.
Will do.
Cheers!
On Tue, Oct 16, 2012 at 5:17 PM, Gui Iribarren gui@altermundi.net wrote:
Too bad you don't have all default ar71xx router images ready to flash.
Will do.
Here you go,
http://openwrt.altermundi.net/snapshots/r33399/ar71xx/batman-ipv6/
They are built using this ImageBuilder
http://openwrt.altermundi.net/snapshots/r33399/ar71xx/OpenWrt-ImageBuilder-a...
with PACKAGES='kmod-batman-adv kmod-ipv6 -dnsmasq dnsmasq-dhcpv6 ip6tables kmod-ath9k-htc safe-reboot iperf qos-scripts -ppp -ppp-mod-pppoe mini-snmpd'
other than that, it's a vanilla openwrt. so after flashing, you can telnet to 192.168.1.1 and
opkg update opkg install batman-adv-auto-gw-mode reboot # so that uci-default scripts are run
:)
alternatively, you can download our ImageBuilder.tar.bz2 and generate your own images, adding "batman-adv-auto-gw-mode" to the PACKAGES argument.
On Tue, Oct 16, 2012 at 10:44 PM, Gui Iribarren gui@altermundi.net wrote:
i think i don't fully understand your setup. could you care to describe it a little bit further?
The setup I would like is quite simple. I would like a mesh exporting 2 ssid. The private one would be a transparent bridge to the WAN network, because I don't want the mesh nodes to handle the routing thing, and let the existing network as it is. Here, the WAN network is in fact the existing LAN. The second network would be a public network, with coova-chilli handling the whole network. There would be a single hotspot controller in the gateway node. This is why I would need to know which node is connected to internet. I know the "gateway" node is not really a gateway as it is bridged.
Here you go,
http://openwrt.altermundi.net/snapshots/r33399/ar71xx/batman-ipv6/
Thanks. ipv6 in the name means that it is compatible with ipv6? or does it need ipv6?
Do you have a link to somewhere explaining all the features of your firmware? You may create a readme file somewhere explaining all this, including the network achitecture?
I may have found a possible solution by parsing the output of batctl transglobal, and look for the gateway mac address. If the gateway is in the transglobal table, it is accessed through the mesh, and it is probably not connected directly to the router.
If 2 nodes are connected to the same wired ethernet network, there will be 2 "gateways", and I will have to do something to detect this, maybe using some broadcast?
On Wed, Oct 17, 2012 at 9:31 AM, Sophana K sophana78@gmail.com wrote:
On Tue, Oct 16, 2012 at 10:44 PM, Gui Iribarren gui@altermundi.net wrote:
i think i don't fully understand your setup. could you care to describe it a little bit further?
The setup I would like is quite simple. I would like a mesh exporting 2 ssid. The private one would be a transparent bridge to the WAN network, because I don't want the mesh nodes to handle the routing thing, and let the existing network as it is. Here, the WAN network is in fact the existing LAN. The second network would be a public network, with coova-chilli handling the whole network. There would be a single hotspot controller in the gateway node. This is why I would need to know which node is connected to internet. I know the "gateway" node is not really a gateway as it is bridged.
Here you go,
http://openwrt.altermundi.net/snapshots/r33399/ar71xx/batman-ipv6/
Thanks. ipv6 in the name means that it is compatible with ipv6? or does it need ipv6?
Do you have a link to somewhere explaining all the features of your firmware? You may create a readme file somewhere explaining all this, including the network achitecture?
On Wed, Oct 17, 2012 at 6:14 PM, Sophana K sophana78@gmail.com wrote:
I may have found a possible solution by parsing the output of batctl transglobal, and look for the gateway mac address. If the gateway is in the transglobal table, it is accessed through the mesh, and it is probably not connected directly to the router.
It's more.. robust.. if you parse translocal table instead. BUT...
Why not just connect the gateway to the LAN switch (or permanently bridge the WAN, which is equivalent)? Why do you want to "break" the bridge? Under what circumstances does that make sense (or why is it a problem to leave the WAN bridged when the gateway is not directly connected)?
With this solution (if it works), both the WAN(private) and LAN(public) network would always remain bridged to the mesh and LAN and WAN ethernet ports.
The script has to determine if it is the gateway, mainly because there must be only one coova-chilli hotspot instance which manages the LAN network. This coova-chilli IS the gateway for the LAN (public) network. Note that it seems that coova-chilli has a cluster mode which is not documented, and seems to allows multiple hotspot instances to work in failover mode. (have to test it)
About translocal and transglobal tables, if I understood correctly, translocal shows only mesh nodes, while transglobal shows all the mac addresses in the arp table?
On Fri, Oct 19, 2012 at 6:45 AM, Gui Iribarren gui@altermundi.net wrote:
It's more.. robust.. if you parse translocal table instead. BUT...
Why not just connect the gateway to the LAN switch (or permanently bridge the WAN, which is equivalent)? Why do you want to "break" the bridge? Under what circumstances does that make sense (or why is it a problem to leave the WAN bridged when the gateway is not directly connected)?
b.a.t.m.a.n@lists.open-mesh.org