Network Config: two networks

Hi,
I am looking to enable both Ethernet and WiFi interfaces, where the Ethernet is on a subnet connected to the internet via VPN (192.168.100.0 Gateway 192.168.100.1) and the WiFi is connected to the home network (192.168.200.0, no Gateway.) All internet streaming will go to the VPN, and only KODI notifications will be sent via WiFi.

To achieve this I need to enable static IPs for both interfaces. I am only able to configure one interface via My OSMC. Any suggestions how to do this configuration using perhaps systmctl or Conman commands?

Thanks,

AlleyCat

Best to set the static IP addresses in the router, based on the MAC addresses.

Well, to avoid writing this again, have a look at

starting with chapter

4.2.1 Assign a Static IP Address to Your OSMC Device

to get the idea how to do that.

JimKnopf, thanks. I used the tutorial to enable two static IP addresses on two different networks for the eth0 and wlan0. The WiFi doesn’t start automatically. How do I set Debian to connect to WiFi on boot? If I get the WiFi to connect, I will achieve the connections to two different networks on boot.

Thanks,

AlleyCat

Well, here really seems to be something odd with connman but first check in

/var/lib/connman → the related service directory

the content of the settings file.
It should contain AutoConnect=true and the Passphrase= as well.

Again look at the how-to article [HowTo] Configure Tvheadend 4.2 and the Sat>IP Server AVM FRITZ!WLAN Repeater DVB-C on OSMC

and look for the service /etc/systemd/system/ip-alias.service defined there as an example for you.

In your case your service should contain the ExecStart for specific connmanctl commands

/usr/bin/connmanctl scan wifi
/usr/bin/connmanctl connect <your wifi service>

In theory that should do the trick.

Tried this on a Vero 4k and ended in this service workaround till this timing issue can be solved

[Unit]
Description= Tries to auto connect to wifi
After=connman-wait-for-network.service
Requires=connman-wait-for-network.service
[Service]
Type=oneshot
ExecStartPre=/usr/bin/connmanctl enable wifi
ExecStartPre=/bin/sleep 20
ExecStart=/usr/bin/connmanctl services
ExecStartPost=/usr/bin/connmanctl connect wifi_<your wifi service>
[Install]
WantedBy=multi-user.target

ExecPres are executed serially and ExecPosts after ExecStart was done successful. There is an ugly sleep which should care about the already running scan wifi till finished. Adapt the time in seconds by your own. Hope this helps as workaround.

So, finally an easier trick works on my system and enabled Wifi to my SSID on every boot and also enabled the ethernet interface:

In file /etc/connman.conf I changed line

PreferredTechnologies=ethernet,wifi
to
PreferredTechnologies=wifi,ethernet

that’s all. But I do not know whether this is just an unwanted side effect.