DCHP Server and connman

Dear OSMC community,

I’m struggling a bit in understanding how to setup a DHCP server on the RaspberryPi running OSMC (July '19 version).
After installing isc-dhcp-server from the repositories, a static IP adress for eth0 needs to be specified. Since OSMC is using connman for network management, setting up a file /etc/network/interfaces doesn’t help per default as it is ignored. Unfortunately, many tutorials for DHCP servers use this approach.

Even though there are some posts regarding issues with connman and dhcp settings, I couldn’t figure out how to use connman to specify a static IP adress (and other required details) for the eth0 interface in order to use it with the isc DHCP service.

Hence, I hope to find some support here. Thanks a lot in advance!

setting up a specific ip adress is best done in the router not in the client, however its possible to set a static ip in connman and there are loads of tutorials on it also its possible to do all of this in the myosmc app.

You can do this in the My OSMC add-on in Kodi. Just go to the network section>wired>configure network manually.

Thanks for the suggestions that have been brought up.

I’m new to network setup, hence it’s a bit difficult to get things straight. The Pi is supposed to act as a DHCP server in a very small local network - there’s no router involved.

In My OSMC there is no option to manually setup a network, only to enable or disable the interface (which is as of now not yet connected).

Trying to use connman for setting the IP, for example with connmanctl config ethernet_MAC_cable ipv4 manual 192.168.10.2 255.255.255.0 192.168.10.1
This command results in an error Method "SetProperty" with signature "sv" on interface "net.connman.Service" doesn't exist

Any help is much appreciated.

I think you’ll have a better chance of getting it to work once the ethernet interface is connected.

If you click on “enable” it will spend a few seconds looking for a dhcp server and when that fails it automatically switches to the screen that allows you to set static network settings. This sets everything in connman so there should be no need to do anything in the command line.

If whatever this is that your setting up has no router, no internet, and only a couple devices, then it may not even be worth the trouble of setting up a dhcp server. Just set static IP’s on all the devices.

May I add something to this thread, because that’s a good point, but not always feasible. There is for instance an IP camera (HiKam Q8) which I try to include in a miniature LAN cable network with an Vero 4K+ and OSMC as the center piece. It’s not possible to assign a static IP address to this camera, but the camera has a good value for money and picture quality. What would you recommend to install as the DHCP server?

I would be surprised if that camera didn’t actually let you set it static. I didn’t see where there was a manual but you could contact support. If it is missing from their phone app it is still probably something that is still available with a web interface. I don’t personally know how you would go about configuring connman to enable a dhcp server as i’ve never looked into it but it probably isn’t any different than any other Debian distro using connman if you did a general web search on the topic.

Normally any LAN has a router that would act as a DHCP server.
Or are you trying to setup a LAN without any router?

1 Like

That’s right, a completely isolated LAN cable network.

ConnMan’s tethering functionality could probably act as a DHCP server, but I don’t know the full details of it.

If you’re 100% sure that the camera needs DHCP, the simplest solution is surely to use a cheap router, both as the switch and the DHCP server. Most of us have one or two kicking around the house.