Force DashboardService to use specific IP address

  • Platform information:
    • Hardware: Synology DS216play
    • OS: DSM 6.1.4-15217 Update 5
    • Java Runtime Environment: Oracle 1.8.0_151-0045
    • openHAB version: 2.2.0.010
  • Issue of the topic:
    My setup has bound 5 different IPv4 addresses to eth0, namely:
    192.168.2.4/24
    192.168.2.40/24
    192.168.2.41/24
    192.168.2.42/24
    192.168.2.43/24
    The first one (192.168.2.4/24) is always active whereas the other 4 depend on the running state of another package.
    So it is crucial for me to configure openHAB to use the primary address (192.168.2.4/24) to avoid changing firewall rules depending on the running state of a unrelated software package.
    Log of startup:
[INFO ] [er.internal.HomeBuilderDashboardTile] - Started Home Builder at /homebuilder
[WARN ] [g.eclipse.smarthome.core.net.NetUtil] - Found multiple local interfaces - ignoring 192.168.2.42
[WARN ] [g.eclipse.smarthome.core.net.NetUtil] - Found multiple local interfaces - ignoring 192.168.2.41
[WARN ] [g.eclipse.smarthome.core.net.NetUtil] - Found multiple local interfaces - ignoring 192.168.2.40
[WARN ] [g.eclipse.smarthome.core.net.NetUtil] - Found multiple local interfaces - ignoring 192.168.2.4
[INFO ] [.dashboard.internal.DashboardService] - Started dashboard at http://192.168.2.43:8080
[INFO ] [.dashboard.internal.DashboardService] - Started dashboard at https://192.168.2.43:8443
[INFO ] [thome.model.lsp.internal.ModelServer] - Started Language Server Protocol (LSP) service on port 5007

To me it looks like DashboardService binds to the last IP address found in the list.
This is the current config of eth0:

$ ip addr
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP qlen 1000
    link/ether 00:11:32:70:a7:ab brd ff:ff:ff:ff:ff:ff
    inet 192.168.2.4/24 brd 192.168.2.255 scope global eth0
       valid_lft forever preferred_lft forever
    inet 192.168.2.40/24 scope global secondary eth0
       valid_lft forever preferred_lft forever
    inet 192.168.2.41/24 scope global secondary eth0
       valid_lft forever preferred_lft forever
    inet 192.168.2.42/24 scope global secondary eth0
       valid_lft forever preferred_lft forever
    inet 192.168.2.43/24 scope global secondary eth0
       valid_lft forever preferred_lft forever
    inet6 fe80::211:32ff:fe70:a7ab/64 scope link
       valid_lft forever preferred_lft forever

I have tried to configure the primary address in the Configuration->System->Network Settings but this also lead to the same result (all IP addresses are in the same subnet).
Is there a way to resolve the problem?
Thanks a lot in advance!
Kind regards

Michael

Hi @michaelp, does the following post help? It shows you that you can set the subnet in the textual configuration:

The referred folder in a manual installation would be : conf/services/

1 Like

since all secondary IPs are on the same subnet (192.168.2.x … by the way… that’s a strange setup :slight_smile: ) , maybe he should use both options ?

not sure if this will help

Hi @Benjy,
thanks for the suggestion.
Indeed I have tried this, see my original post:

I have tried to configure the primary address in the Configuration->System->Network Settings but this also lead to the same result (all IP addresses are in the same subnet).

It would be the solution if the 5 addresses were in different subnets. But in my case they are in the same subnet.

Hi @Dim,
indeed it is. The remote device (AVM FRITZ!Box 6490) checks for allowed connections based on addresses and this is the only way to have 4 concurrent connections. :slight_smile:

Unfortunately that also didn’t help. The log message still states that the DashboardService bound to the wrong address. :frowning:

But meanwhile I discovered that this log message (“Started dashboard at http://192.168.2.43:8080”) is leading into the wrong direction.
In fact openHAB uses tcp6 on my setup, see netstat output:

tcp6       0      0 :::8443                 :::*                    LISTEN      1029       2814791    24665/java
tcp6       0      0 :::8080                 :::*                    LISTEN      1029       2815151    24665/java
tcp6       0      0 192.168.2.4:8080        192.168.2.22:50552      ESTABLISHED 1029       2831435    24665/java
tcp6       0      0 192.168.2.4:8080        192.168.2.22:50550      ESTABLISHED 1029       2814862    24665/java
tcp6       0      0 192.168.2.4:8080        192.168.2.22:50554      ESTABLISHED 1029       2831437    24665/java
tcp6       0      0 192.168.2.4:8080        192.168.2.22:50551      ESTABLISHED 1029       2831434    24665/java
tcp6       0      0 192.168.2.4:8080        192.168.2.22:50555      ESTABLISHED 1029       2831438    24665/java
tcp6       0      0 192.168.2.4:8080        192.168.2.22:50553      ESTABLISHED 1029       2831436    24665/java

So the connection is established to the right address despite of the different message log.
For me this is fine!
Thanks for all your help in this matter.
Kind regards

Michael

1 Like