強制在路由器的另一個介面上發布種子

強制在路由器的另一個介面上發布種子

我們有一個 MikroTik 路由器,有 2 個 WAN main(良好且昂貴的頻寬)和backup.main適合我們的日常使用,backup頻寬較慢。

我們有一台 Synology NAS 處理下載,我想強制透過backup網關上的介面完成 torrent 下載。這是我目前的配置:

/ip firewall filter add action=accept chain=forward comment="H2G2: Allow forward to DSM" dst-address=192.168.1.3 dst-port=22,80,139,443,445,5001,32400 protocol=tcp
/ip firewall filter add action=accept chain=forward comment="H2G2: Allow forward established, related replies to H2G2" connection-state=established,related dst-address=192.168.1.3 protocol=tcp
/ip firewall filter add action=accept chain=forward comment="H2G2: Allow established and related replies from H2G2" connection-state=established,related protocol=tcp src-address=192.168.1.3
/ip firewall filter add action=drop chain=forward comment="H2G2: Drop everything else not coming from backup" dst-address=192.168.1.3 in-interface=!ether2-backup

/ip firewall nat add action=masquerade chain=srcnat out-interface=ether1-main
/ip firewall nat add action=masquerade chain=srcnat out-interface=ether2-backup
/ip firewall nat add action=dst-nat chain=dstnat dst-port=22 in-interface=ether1-main protocol=tcp to-addresses=192.168.1.3 to-ports=22
/ip firewall nat add action=dst-nat chain=dstnat dst-port=80 in-interface=ether1-main protocol=tcp to-addresses=192.168.1.3 to-ports=80
/ip firewall nat add action=dst-nat chain=dstnat dst-port=139 in-interface=ether1-main protocol=tcp to-addresses=192.168.1.3 to-ports=139
/ip firewall nat add action=dst-nat chain=dstnat dst-port=443 in-interface=ether1-main protocol=tcp to-addresses=192.168.1.3 to-ports=443
/ip firewall nat add action=dst-nat chain=dstnat dst-port=445 in-interface=ether1-main protocol=tcp to-addresses=192.168.1.3 to-ports=445
/ip firewall nat add action=dst-nat chain=dstnat dst-port=5001 in-interface=ether1-main protocol=tcp to-addresses=192.168.1.3 to-ports=5001
/ip firewall nat add action=dst-nat chain=dstnat dst-port=32400 in-interface=ether1-main protocol=tcp to-addresses=192.168.1.3 to-ports=32400
/ip firewall nat add action=dst-nat chain=dstnat dst-port=6881 in-interface=ether2-backup protocol=tcp to-addresses=192.168.1.3 to-ports=6881
/ip firewall nat add action=dst-nat chain=dstnat dst-port=6881 in-interface=ether2-backup protocol=udp to-addresses=192.168.1.3 to-ports=6881

/ip firewall mangle add action=mark-routing chain=prerouting dst-address=!192.168.1.0/24 new-routing-mark=toBackup passthrough=yes src-address=192.168.1.3

; Then route 0.0.0.0/0 toBackup routing mark to ether2-backup

所以基本上,我允許將這些連接埠 (22,80,139,443,445,5001,32400) 的封包轉送到 NAS ( 192.168.1.3),並丟棄所有其他不是來自該backup介面的封包。我對這些連接埠進行 NAT。我將 1.3 中的連接標記為不適用於本地網絡,並使用routing-mark toBackup.顯然,我將路線0.0.0.0/0標記toBackupether2-backup並且有效。如果我將 NAS 訪問到轉發的連接埠之一,那就沒問題了。其他一切都透過備份進行。

現在的問題是,一切都要去備份。我不太了解 torrent、PEX、DHT 協議,我不確定伺服器及其檔案何時發布廣告。我知道 Torrent 和 Magnet 的追蹤器都嵌入了追蹤器,甚至可以透過 HTTP 訪問,因此這取決於檔案的廣告時間。如果當客戶端向追蹤器宣布自己時它們被公佈,那麼我可能會保留所有內容進行備份。如果它們僅在從外部聯繫時才被宣布(目前,我的監聽端口是 6881 UDP 和 TCP),那麼最好阻止來自 的 6881 ether1-main,但我擔心客戶端會通過 HTTP 向跟踪器宣布自己(因此通過ether1-main和顯然會在同一個IP 上為自己做廣告,而不是ether2-backup)...

你們知道我如何實現它嗎?

相關內容