What's new

YazFi - NAT to guest wifi

  • SNBForums Code of Conduct

    SNBForums is a community for everyone, no matter what their level of experience.

    Please be tolerant and patient of others, especially newcomers. We are all here to share and learn!

    The rules are simple: Be patient, be nice, be helpful or be gone!

r000t

New Around Here
Hi,

I have some IoT devices on guest Wi-fi, which only accept connection if SRC IP belongs to the same network (e.g., Yeelight smart lights).
I know it is possible to add custom IPTABLES commands to
Code:
/jffs/addons/YazFi.d/userscripts.d/custom.sh
, but I am not that skilled at IPTABLES and afraid of breaking things.

Can you please advise which rules do I need to add so that the trafiic from the main Wi-fi will be NATed to the guest Wi-fi in a "one way to guest" mode?
 
Code:
#!/bin/sh
#iptables -I YazFiFORWARD -i wl0.1 -o br0 -d 10.0.1.5 -j ACCEPT
iptables -t nat -A POSTROUTING -o wl0.1 -s 10.0.1.5 -j MASQUERADE

This worked for me where 10.0.1.5 - my Home Assistant server inside the home network. Yeelight's local mode now works with the guest network as intended.
 

Similar threads

Latest threads

Support SNBForums w/ Amazon

If you'd like to support SNBForums, just use this link and buy anything on Amazon. Thanks!

Sign Up For SNBForums Daily Digest

Get an update of what's new every day delivered to your mailbox. Sign up here!
Top