Hey there.
I have some Xiaomi IoT devices in a YazFi guest network (
To be clear, what I'm trying to do: Whenever a device from the main network (
Any idea, what I'm doing wrong? Any help is highly appreciated. Thanks a lot in advance!
Edit: I'm testing if the IP gets masqueraded by running an Nginx server on a machine in the guest network and looking at it's access logs when triggering requests from the main network. As a said before, it still shows the original IP from the 50.0/24 subnet...
Cheers,
Kris
I have some Xiaomi IoT devices in a YazFi guest network (
w0.1
, 192.168.2.0/24
). Unfortunately, some Xiaomi devices only respond when a request comes from the same subnet. So, I'm trying to do some masquerading with custom iptables rules.To be clear, what I'm trying to do: Whenever a device from the main network (
192.168.50.0/24
) tries to access this guest network it will get the IP 192.168.2.2
(which is not used by any device afaik). But unfortunately, it's not working as intended. I'm pretty stuck and need some help. This is the custom rule I'm using right now, it shows up when running iptables -L -t nat -v
but doesn't seem to do anything.
Code:
iptables -t nat -A POSTROUTING -o w0.1 -s 192.168.50.0/24 -d 192.168.2.0/24 -p all -j SNAT --to 192.168.2.2
Any idea, what I'm doing wrong? Any help is highly appreciated. Thanks a lot in advance!
Edit: I'm testing if the IP gets masqueraded by running an Nginx server on a machine in the guest network and looking at it's access logs when triggering requests from the main network. As a said before, it still shows the original IP from the 50.0/24 subnet...
Cheers,
Kris
Last edited: