Multiple Network Adapters

Hello,

I installed OH2 on a Raspberry PI 2 with Raspbian 9.
The Raspi is linked to my internal network via the LAN interface. Everything works fine. I have connected my Homematic to OH2 and it’s working well.
Than I added a WLAN USB interface and configured it. In my home I have a guest network, where also my TV and other devices are connected. For that reason I’d like to build the OH2 multihomed.
But after the reboot OH2 picks the IP interface of the WLAN ond not the LAN. So the connection to the Homematic doesn’t work anymore.
How can I control which IP address is the default for OH2? How can I link OH2 to a certain network card?

Regards,
Siggi

This is not an openHAB problem, this is a problem on your operating system. See
https://www.raspberrypi.org/forums/viewtopic.php?t=191140
how to set a static ip to your ethernet adapter.
Note that any other tutorials you may find often refer to “eth0” as your lan adapter, this is not true anymore for Raspbian Stretch (9), the syntax has changed. The new adapter names are something like enxb827ebdc0d1f
You may find the adapter name through ifconfig

May be I didn’t explain the problem clear enough:
The IP addresses are fixed. However OH2 binds to the IP address of the wifi adapter and doesn’t seem to communicate through the LAN interface anymore. The Homematic gateway however is on the LAN.

It’s still a problem on your operating system.

OpenHAB 2 seems to have problems with the new predictable names of network interfaces. Once I renamed them to the old “eth0” and “wlan0”, it works again.

1 Like

On my file server that is also the development system for OH, OH2 picks the IP of the tun0 interface created by openVPN.

This interface is the last one that has an IPv4 in ip addr list. Dunno if that matters tho.

you didn’t mention the openHAB2 release that you are running, but in the latest Snapshot (1032) there is an option in PaperUI for this:

you can also set the IP Subnet in /etc/openhab2/services/runtime.cfg:

org.eclipse.smarthome.core.net.NetUtil:primaryAddress=172.16.13.0/24
2 Likes

It is still the same. I made all these settings to eth0 X.X.X.100 and it still grabs the wlan0 with .101 … (Yes, they are in the same subnet)

I was also having a problem with different interfaces

I disabled my WiFi completely on the rpi too stop this problem as I’m using ethernet there’s no point in having WiFi enabled

The funny thing is that the Yeelight Binding is not working when something else than WiFi only is running…

So I cannot have only LAN or LAN + WLAN. Hope this option can fix it, so the Pi can stay with ethernet too or only…