Hej,
On 09:47 Tue 02 Sep , Patrik Flykt wrote:
On Fri, 2014-08-29 at 15:01 +0200, Benjamin Block wrote:
I just wanted to ask, if it is possible to configure connman in a way
that I can switch to specific settings depending on the location I am at
(no problem if I have to trigger this switch) and maybe fall back to
dhcpcd or other stuff like it, if I get to a new location.
Thing is, I use my laptop in 4 different locations, each location has
its own set of settings. 3 of them require me to use a specific ip, 1
even a specific firewall-setting (iptables). I'd like to configure one
profile for each of those location (state the config for each of my
devices [eth0, wlan0, wwan0]) and then let connman switch between these
profiles - likely by using a connmanctl-command. If I am at a new
location, then I'd fall back to all the fancy automation.
ConnMan does not do any additional profile based configuration, so that
has to be added by an external program.
The perhaps easiest way of solving this would be a separate tool, which
moves (copies) required ConnMan .config files to and
from /var/lib/connman. The ownership of that directory should be set
properly, as the current root.root user and owner is merely just a
placeholder for the tool developer or distro maintainer to update when
needed.
The easiest solution might be to store all .config files relevant to a
certain profile in a specific directory, e.g.
'/var/lib/name-of-tool/profiles/name-of-profile/*.config'. Based on
user selection the .config files based on the previous profile are to be
removed with the .config files for the new profile added
to /var/lib/connman. It is a good idea to remove only the previous
profile specific .config files from /var/lib/connman and not every file,
as some other program(s) or the user him/herself may have added
specific .config files for some other purpose than the profiles handled
by this tool.
Ok, thx for the elaborate answer. I'll think about it. For my use only
it might be easier/same work to just write a script to handle the
network-settings myself, as most of them are not that complicated
(remove some ips, add some new, add some route and add most turn on
wlan). I've been doing this by hand for some time now, and was only to
lazy to put them into a script. If I find the time, I might also handle
this by augmenting connman.
Is that possible and if yes, how? I was locking at the documentation
coming with connman, but they seem quite outdated in places (for
example, I was reading `config-format.txt` and tried to create such a
config at `/var/log/connman/work.conf`; but this was ignored
'/var/lib/connman/work.config' is the correct name and location for this
file.
Ah ok, might have been the wrong extension (log was a typo in the
mail).
completely). Also I wonder how to tell connman how to ignore some of my
network-devices (I tried the command line option and the option
`/etc/connman/main.cfg`), it seems to ignore me quite good on this.
And that would be '/etc/connman/main.conf'.
Indeed, that was the file (typo in mail). In there I put (under
[General]):
NetworkInterfaceBlacklist=vmnet,vboxnet,virbr,ifb,dummy0,sit0,tunl0
But connman would still handle dummy0 for example (bring it up, mention
it in the log). For some reason it also messed up my wlan0 quit good. Had
to hard reset it via rfkill to get it back to work. But I can't say for
sure, if that was connman's fault or my own, so it might have been my
own.
--
BOFH Excuse #197:
I'm sorry a pentium won't do, you need an SGI to connect with us.
--
best regards,
- Benjamin Block
pgp0LBZ9BhrPN.pgp
Description: PGP signature
___
connman mailing list
connman@connman.net
https://lists.connman.net/mailman/listinfo/connman