gregcube / unifi-mimic

Connect directly to UNVR with UniFi Protect mobile app on a different subnet.
19 stars 2 forks source link

still no access over vlan #4

Closed petettx closed 8 months ago

petettx commented 1 year ago

"This hack is no longer needed. Direct connections now work over vlans/ subnets. Not sure when Unifi introduced this but it seems to have happened quietly."

Are you sure about that? For me it still doesn't work over vlans.

gregcube commented 1 year ago

I think so. I'm on an Android phone, which is on a different vlan than my unifi nvr. My firewall allows these two networks to talk to each other. The Unifi Protect app reports, "You are connected directly" -- without unifi-mimic running on my rpi4.

petettx commented 1 year ago

That's weird. In my case it doesn't. I even allowed all port to be accessed. The same time the unifi network app works fine and says "you are directly connected". Which version of the app do you have?

jirkapas commented 1 year ago

The question is how does UBNT intend for this cross vlan access to work. I haven't yet had the time to research or test this but I suspect that it only works with cloud connected NVRs and the app just gets the NVRs local IP via UBNTs server and then blindly tries to connect to this IP every time its on a WLAN network. I don't really see any other way for this to work since there is no way for the app to discover devices behind a router.

gregcube commented 1 year ago

That's weird. In my case it doesn't. I even allowed all port to be accessed. The same time the unifi network app works fine and says "you are directly connected". Which version of the app do you have?

App version: 1.15.0

I may stand corrected. It's been awhile. After some inspection I just realized unifi-mimic is indeed running on my rpi4. It must have been rebooted at some point and automatically started. I killed unifi-mimic and "You are directly connected!" no longer appears; restarted unifi-mimic and it's working again. I could've sworn at some point it was working without unifi-mimic. Maybe something changed (again?) on the UBNT side. When I have some time I'm going to experiment some more.

EDIT: I have a VPN setup with wireguard on my network (another vlan) and that used to run unifi-mimic as well. I needed to re-enable it. I'm certain it was working before without.

petettx commented 1 year ago

too bad. was hoping that annoying issue has been finally solved by ubiquiti. I am looking for a way run some sort of mimicing on an openwrt but haven't found a solution yet.

gregcube commented 9 months ago

I'm not that familiar with openwrt. Can you SSH to your router and install libnet? You might be able to compile this for openwrt.