Hi,

On Tue, 2015-10-13 at 08:49 +0000, John Ernberg wrote:

> ConnMan runs on the embedded system, which is the USB host side.
> And when an USB gadget connects, I want to start a DHCP server on the
> interface provided by cdc_ether so that the USB gadget that connects
> can receive an IP by using a DHCP client.

USB host side is counted as a regular ethernet. So 'ethernet' tethering
is the one you want to configure.

> I have parts of the file system as read only, so ConnMan does not
> remember things between reboots.

ConnMan stores its technology state into /var/lib/connman/settings, if
this file is not perserved over reboots maybe tmpfiles from systemd can
create a suitable one into that directory? Or some other shell scripting
during boot.

> > The networks that show up as services are the ones where ConnMan is a
> > end host/client. Tethering creates a local network bridge, 'tether', and
> > starts a DHCP server on it. The tethered network does not show up as a
> > service, as it is not an upstream connection.
> 
> Ok, got it. I found the tether interface, the USB gadget side does not
> receive an IP however.

In the USB client/gadget end, especially when running Linux also here,
it usually is a matter of being able to (automatically) load the proper
drivers for the gadget device. It also is a matter of USB client mode
setting, the USB client/gadget is probably registered automatically for
some other (Linux kernel module) profile instead of networking.

> Could this be caused by that we do not always have any other active
> connections?

The upstream connections in ConnMan, i.e. services, do not need to be
enabled for thethering to work. Only routing/internet connectivity is
affected by the presence or absence of a connected service.

>  I.e. should this be done differently if I want to have a connection
> that is end-to-end, without bridging?

The connection between the USB host device running ConnMan and the other
device with the USB client connection already provide an end-to-end
connection over IP. If ConnMan has an service connected providing an
upstream internet connection, ConnMan sets up a NAT to get the tethered
devices connecting to the internet. The brigde interface comes into play
as it is the smartest way of connecting all tethering technologies and
interfaces into one network served by a single DHCP server. On the
winning side all devices tethered can now connect to each other via IP,
be they connected via Bluetooth, USB, ethernet or wifi.

Cheers,

        Patrik

_______________________________________________
connman mailing list
connman@connman.net
https://lists.connman.net/mailman/listinfo/connman

Reply via email to