We are building a system which has 4 network interfaces: ethernet (private), ethernet
(public), wifi, cellular.
We need to keep multiple of them (ideally all, if available) on-line, and allow the
applications to select which one they want to use on a per-socket basis. This includes
access to internet, so we would need a default route established on every interface.
Also, there will be a management application, which will select the preferred interface,
which should be used by all other "normal" applications.
As far as I can see, there are two potential options to do that:
1. Add multiple default routes to the main routing table, with different metrics. In that
case to select an interface an application should call setsockopt(SO_BINDTODEVICE).
Example: ping -I eth1
2. Create multiple routing tables with iproute2, and rules filtering based on source
address. Application uses bind(adapter ip address) before connect(). Example: ping -I
Our primary use case is Mosquitto, an MQTT client. It only currently implements option 2,
although option 1 could be ported into it easily enough.
As far as I can see, currently, neither option is implemented in Connman. There is only
one on-line interface at a time.
The session API, and per-application routing, seems to be the closest thing, but it still
does not allow the application to freely chose which interface it wants to use.
There was a discussion here, in March, about something very similar to what we are trying
Is that something that can be integrated into Connman?
Alternatively, is there any other way of achieving our requirement of keeping multiple
on-line interfaces at the same time with Connman?
We have some development time allocated to this feature, so we could work on providing it
upstream, if it could be accepted in one form or another.
Thanks for help with this.