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?
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.
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.