Sticky IP address

This could very well be a UniFi issue, but I think I have it down to something weird happening in HA.

I had a static IP set: 192.168.1.51

I wanted to change over to a new VLAN with which would give HA the IP: 192.168.9.150.

In UniFi I set it as a fixed address, and I tried a few variations of setting HA to use DHCP and also tried having it set a static IP.

At some point, I ended up with two IPs (both those above) configured in HA for ipv4 for the same interface (there is only one interface in my setup).

I ended up accessing the VM that runs HA directly and used nmcli to clear all network settings (rm /etc/NetworkManager/system-connections/*, then took the interface down, then up).

I then shut down the VM and changed the network adapter’s MAC address. In UniFi I had it forget the old MAC address client and created a new one with the new MAC. I then started the VM back up.
At this point, there is no reason to think UniFi should assign the old IP.

Yet, somehow, HA ended up with the old 192.168.1.51 IP. At this point, I’m assuming this is HA doing this since UniFi would have no reason to associate the new MAC with the old IP on it’s own.

Any ideas?

Have you set up rules to point HA to the right VLAN and all the other stuff and to send the traffic to the right VLAN

Also, did you set the IP address for the correct interface in HA? You should have a VLAN specific interface. Mine is set in the host OS as I’m running supervised.

Thanks!

Didn’t make it that far yet. The VLAN was basically configured the same as the default network, just with a different subnet. I was just trying to get HA online using the VLAN before setting anything additional up. I have other devices on the VLAN and they’re working properly.

Because HA is in a VM, I only have a single interface (which is a simple bridged nic, it has its own physical nic and uses the adapter bridged). After disabling my original static IP the interface in HA was set to just use DHCP, but somehow it ended up still having the static IP on the default VLAN. Again, I don’t know of any way UniFi would have done that since I had changed the VM’s nic’s MAC address. So as far as I can tell, something in HA seems to be hanging on to that .1 subnet.

Suffice to say - I spent hours on this today and have no idea what is causing it. Somehow HA is back online, albeit on the wrong subnet/vlan.

I had lost track of this, but I contacted UniFi about it back in May, and it turns out the problem (as suspected) was between the computer and the chair.

@myle was on the right track

Apparently, in addition to setting a Fixed IP in the UniFi network app, I also need to set the Port Profile for the port the VM’s NIC is attached to the VLAN (instead of setting it to All).

If my understanding is correct, as configured, the default “All” port profile allows devices from any VLAN, however, they will only be properly identified as being on that VLAN if that device/interface/software knows that a VLAN is involved and it is configured to use it - otherwise it will keep tagging with the default VLAN (which for UniFi is the management VLAN). By changing the port profile to force the VLAN to be tagged on traffic coming from that port, it fixes the issue.

I believe, ideally, I’d also set HA to use the tagged VLAN, but not clear on how to do that yet.