gfx wrote:
請問這台server...(恕刪)
guoshuchang wrote:是我的錯,我忘了src-nat不能用in-interface
沒辦法新增,會出現...(恕刪)
不使用in-interface沒關係,把src-address設192.168.10.0/24再新增即可.
讓RouterOS判斷某個設備是否已連接到RouterOS上
(例如回到家中,手機接上家用WiFi,在RouterOS上取得一個DHCP IP)
然後讓某一條防火牆關閉
/ip firewall filter
add action=drop chain=forward log=yes src-address=192.168.88.189 disabled=yes
若該設備斷開連結(例如出門)
則讓這條防火牆開啟
/ip firewall filter
add action=drop chain=forward log=yes src-address=192.168.88.189
應該是透過script去更新filter對嗎? 請指教謝謝.
我的需求是當我回到家中, 就開啟某幾條防火牆, 反之若離開家裡, 則關閉這些防火牆.
我是否在家中的依據是我的手機是否有連上WiFi.
謝謝YAWPYNG的指導, 我不知道可以用Netwatch做, 還在思考Script要怎麼寫.
以下是做法
綁定手機ip
到IP DHCP-SERVER LEASE這個頁面對要綁定的device按下右鍵選Make static
CLI :
/ip dhcp-server lease
add address=192.168.ooo.xxx client-id=aaa mac-address=bbb server=defconf
建立防火牆
/ip firewall filter
add action=drop chain=forward comment="Drop XXX" out-interface-list=WAN src-address-list=OOO
Netwatch
/tool netwatch
add down-script="/ip firewall filter\\r\\
\\ndisable [find comment=\\"Drop XXX\"]" host=192.168.ooo.xxx interval=30s up-script="/ip firewall filter\\r\\
\\nenable [find comment=\\"Drop XXX\"]"
實測可用, 謝謝.
內文搜尋

X