How to block access to Homeassistant?

Hello friends,
I have a very basic knowledge to networking and linux. I want to allow access to homeassistant for only some machines on my network. For this I am using iptables with the below entries.

-A INPUT -i lo -j ACCEPT
-A INPUT -s 192.168.1.9/32 -p tcp --dport 8123 -j ACCEPT
-A INPUT -s 192.168.1.10/32 -p tcp --dport 8123 -j ACCEPT
-A INPUT -s 192.168.1.13/32 -p tcp --dport 8123 -j ACCEPT
-A INPUT -s 192.168.1.14/32 -p tcp --dport 8123 -j ACCEPT
-A INPUT -p tcp --dport 8123 -j DROP

Now this is working perfectly.

But I am not able to start an add-on “Home-Assistant-Matter-Hub”.
If I remove the last line in my iptable i.e. “-A INPUT -p tcp --dport 8123 -j DROP” then the add-on starts.

What should be the correct iptable entry to make this add-on start?

Kindly help.

Homeassistant is running on docker Rasp pi 4 debian bookworm

Core
2024.11.1
Supervisor
2024.11.2
Operating System
Frontend
20241106.2

log

[ 2024-11-12T07:33:25.888Z ] [ INFO  ] [ Storage                                            ]: Storage location: /config/data
[ 2024-11-12T07:33:25.952Z ] [ DEBUG ] [ matter.js / UdpChannelNode                         ]: Socket created and bound remoteAddress: undefined:5353 localAddress: 0.0.0.0:5353
[ 2024-11-12T07:33:25.963Z ] [ DEBUG ] [ matter.js / UdpChannelNode                         ]: Socket created and bound remoteAddress: undefined:5353 localAddress: :::5353
[ 2024-11-12T07:33:25.974Z ] [ DEBUG ] [ matter.js / UdpChannelNode                         ]: Socket created and bound remoteAddress: undefined:5353 localAddress: 0.0.0.0:5353
[ 2024-11-12T07:33:25.982Z ] [ DEBUG ] [ matter.js / UdpChannelNode                         ]: Socket created and bound remoteAddress: undefined:5353 localAddress: :::5353
home-assistant-matter-hub start

Why do you need to block access on your local network?

Add IP’s of unwanted machines into “bans.yaml” ?