tomaae / homeassistant-mikrotik_router

Mikrotik router integration for Home Assistant
Apache License 2.0
282 stars 43 forks source link

[Question] Why not all NAT rules showing as switches #335

Closed eiakovlev closed 6 months ago

eiakovlev commented 7 months ago

Hi, Could you explain how NAT switches are adding as objects, What is the criteria? I have several NAT rules with different parameters: some of them are masquerade rules with different source networks and destination networks - address lists, some other are dst-nat rules with different Comments. Actually added only couple of rules - only dst-nat and with simple comments - at least without "(" , "|", ")" symbols in comments. So i need to create scripts to enable/disable rules.

Thanks.

tomaae commented 7 months ago

All dst-nat are added, as long as unique id can be built. If there is conflict, you will see it in HA log. https://github.com/tomaae/homeassistant-mikrotik_router/blob/a61dfa5ff7e1e6d2b744e0cdfeee08377e277e2d/custom_components/mikrotik_router/coordinator.py#L972-L991

eiakovlev commented 7 months ago

So, ONLY dst-nat rules available? only=[{"key": "action", "value": "dst-nat"}], masquerade rules are not available?

tomaae commented 7 months ago

srcnat rules are not listed, no

github-actions[bot] commented 6 months ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.

github-actions[bot] commented 6 months ago

This issue was closed because it has been stalled for 5 days with no activity.