Hi all,

we have a couple of questions about “ConnMan” capability. Actually we are using 
it (succesfully) in a GENIVI based Automotive project and we have now new 
requirements to deal with. We read a lot of posts related to this topic but we 
did not find any concreate working example.

Our issue is to make ConnMan working with two different applications, one using 
wifi and the other using ethernet at the same time.

Mainly, the matter is:

How to correctly configure and connect two applications on ConnMan to use 
different technologies and services at the same time?

Moreover, we tried to know the IP used by the two applications (shell), via 
curl ifconfig.me <http://ifconfig.me/>. 

The output of this command for the first application shows an IP address, while 
the same command for the other application reports: curl: (56) Recv failure: 
Connection timed out

Why is this happening?

Thank you in advance for your answer.

Our configuration:
3.19.0-15-generic #15-Ubuntu SMP Thu Apr 16 23:32:01 UTC 2015 i686 i686 i686 
GNU/Linux
(Ubuntu 15.04 on a HP PC)
connmand –version 1.21
Kernel configuration: same as requested in ConnMan README.txt

Main.conf (in /etc/connman)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
[General]
PreferredTechnologies=wifi,ethernet
SingleConnectedTechnology=false
SessionMode=true
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Settings file (in /etc/connman)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
[global]
OfflineMode=false

[WiFi]
Enable=true
Tethering=false

[Bluetooth]
Enable=false
Tethering=false

[Wired]
Enable=true
Tethering=false
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

We created two users adding the following lines:

/etc/group
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
wifi:x:132:wifisession
eth:x:133:ethsession
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

/etc/passwd
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
wifisession:x:120:132:wifisession:/home:/bin/bash
ethsession:x:121:133:ethsession:/home:/bin/bash
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Policy files (in /var/lib/connman/session_policy_local)

wifisession.policy
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
[policy_wifisession]
uid = wifisession
AllowedBearers = wifi
RoamingPolicy = forbidden
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

ethsession.policy
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
[policy_ethsession]
uid = ethsession
AllowedBearers = ethernet
RoamingPolicy = forbidden
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Opened two terminals, connected with the newly created users on each one.

Terminal 1: wifisession user output 
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
wifisession@ $ connmanctl
connmanctl> services
*AO Wired ethernet_68b599eda216_cable
*A HTC Portable Hotspot 61B3 
wifi_0024d76e6c38_48544320506f727461626c6520486f7473706f742036314233_managed_psk
connmanctl> agent on
Agent registered
connmanctl> session connect
Session /sessions/_1_263/net/connman/connmanctl13404 created
Session Update = {
State = connected
Name = Wired
IPv4 = [ Method=dhcp, Address=192.168.1.100, Netmask=255.255.255.0 ]
IPv6 = [ ]
Interface = eth0
Bearer = ethernet
ConnectionType = any
AllowedBearers = [ * ]
}
Session /sessions/_1_263/net/connman/connmanctl13404 connected

connmanctl> connect 
wifi_0024d76e6c38_48544320506f727461626c6520486f7473706f742036314233_managed_psk
Session Update = {
IPv4 = [ Method=dhcp, Address=192.168.1.100, Netmask=255.255.255.0, 
Gateway=192.168.1.1 ]
}
Session Update = {
IPv4 = [ Method=dhcp, Address=192.168.1.100, Netmask=255.255.255.0 ]
}
Session Update = {
IPv4 = [ Method=dhcp, Address=192.168.1.100, Netmask=255.255.255.0, 
Gateway=192.168.1.1 ]
}
Session Update = {
IPv4 = [ Method=dhcp, Address=192.168.1.100, Netmask=255.255.255.0 ]
}
Session Update = {
IPv4 = [ Method=dhcp, Address=192.168.1.100, Netmask=255.255.255.0, 
Gateway=192.168.1.1 ]
}
Session Update = {
State = online
}
Connected 
wifi_0024d76e6c38_48544320506f727461626c6520486f7473706f742036314233_managed_psk
Session Update = {
State = connected
}
Session Update = {
IPv4 = [ Method=dhcp, Address=192.168.1.100, Netmask=255.255.255.0 ]
}

Terminal2, ethsession user output:
ethsession@ $ connmanctl
connmanctl> session connect
Session /sessions/_1_264/net/connman/connmanctl13421 created
Session Update = {
State = online
Name = Wired
IPv4 = [ Method=dhcp, Address=192.168.1.100, Netmask=255.255.255.0, 
Gateway=192.168.1.1 ]
IPv6 = [ ]
Interface = eth0
Bearer = ethernet
ConnectionType = any
AllowedBearers = [ * ]
}
Session /sessions/_1_264/net/connman/connmanctl13421 connected
Session Update = {
State = connected
}
Session Update = {
IPv4 = [ Method=dhcp, Address=192.168.1.100, Netmask=255.255.255.0 ]
}

From a third terminal (none of the above users is using this terminal):
connmanctl> services
*AO HTC Portable Hotspot 61B3 
wifi_0024d76e6c38_48544320506f727461626c6520486f7473706f742036314233_managed_psk
*AR Wired ethernet_68b599eda216_cable

Here we think that having WiFi “online” and ETH “Ready” is sufficient to go to 
Internet.

~$ sudo iptables -t mangle -L
Chain PREROUTING (policy ACCEPT)
target prot opt source destination 

Chain INPUT (policy ACCEPT)
target prot opt source destination 
connman-INPUT all -- anywhere anywhere 

Chain FORWARD (policy ACCEPT)
target prot opt source destination 

Chain OUTPUT (policy ACCEPT)
target prot opt source destination 

Chain POSTROUTING (policy ACCEPT)
target prot opt source destination 
connman-POSTROUTING all -- anywhere anywhere 

Chain connman-INPUT (1 references)
target prot opt source destination 
CONNMARK all -- anywhere anywhere CONNMARK restore

Chain connman-POSTROUTING (1 references)
target prot opt source destination 
CONNMARK all -- anywhere anywhere CONNMARK save

~$ sudo iptables -t filter -L
Chain INPUT (policy ACCEPT)
target     prot opt source               destination         

Chain FORWARD (policy ACCEPT)
target     prot opt source               destination         

Chain OUTPUT (policy ACCEPT)
target     prot opt source               destination        

~$ route -n
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
0.0.0.0 192.168.1.1 0.0.0.0 UG 0 0 0 wlan0
8.8.4.4 192.168.1.1 255.255.255.255 UGH 0 0 0 eth0
8.8.8.8 192.168.1.1 255.255.255.255 UGH 0 0 0 eth0
192.168.1.0 0.0.0.0 255.255.255.0 U 0 0 0 eth0
192.168.1.0 0.0.0.0 255.255.255.0 U 0 0 0 wlan0
192.168.1.1 0.0.0.0 255.255.255.255 UH 0 0 0 wlan0
192.168.1.1 0.0.0.0 255.255.255.255 UH 0 0 0 eth0


~$ ip rule show
0:      from all lookup local 
32766:  from all lookup main 
32767:  from all lookup default

_______________________________________________
connman mailing list
[email protected]
https://lists.connman.net/mailman/listinfo/connman

Reply via email to