Skip to content

Instantly share code, notes, and snippets.

@gilankpam
Last active December 3, 2023 17:13
Show Gist options
  • Save gilankpam/a9b879021c5ce163296756c24b031878 to your computer and use it in GitHub Desktop.
Save gilankpam/a9b879021c5ce163296756c24b031878 to your computer and use it in GitHub Desktop.

Xiaomi Smart devices only accept command from the same subnet. This is openwrt configuration I used to fix that.

iot is the smart devices subnet, including xiaomi devices

192.168.10.8 is my Home Assistant IP

192.168.88.232 is xiaomi device IP

uci add firewall nat # =cfg1793c8
uci set firewall.@nat[-1].name='nat'
uci add_list firewall.@nat[-1].proto='all'
uci set firewall.@nat[-1].src='iot'
uci set firewall.@nat[-1].src_ip='192.168.10.8'
uci set firewall.@nat[-1].dest_ip='192.168.88.232'
uci set firewall.@nat[-1].target='MASQUERADE'
uci commit firewall
service firewall restart
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment