時間ベースのポート転送

時間ベースのポート転送

クライアントが特定のポート(Aと仮定)に接続し、時間とともに別の(ローカル)ポート(BとC)にリダイレクトされるサーバーを設定しようとしています。たとえば、クライアントがAに接続してBに転送する場合は、ポートを変更する必要があるときはCに転送する必要があり、接続を切断しないことをお勧めします。可能ですか?

ベストアンサー1

--matchモジュールを使用して、ルールにいくつかの追加条件を追加できます。

time match options:
    --datestart time     Start and stop time, to be given in ISO 8601
    --datestop time      (YYYY[-MM[-DD[Thh[:mm[:ss]]]]])
    --timestart time     Start and stop daytime (hh:mm[:ss])
    --timestop time      (between 00:00:00 and 23:59:59)
[!] --monthdays value    List of days on which to match, separated by comma (Possible days: 1 to 31; defaults to all)
[!] --weekdays value     List of weekdays on which to match, sep. by comma (Possible days: Mon,Tue,Wed,Thu,Fri,Sat,Sun or 1 to 7 Defaults to all weekdays.)
    --kerneltz           Work with the kernel timezone instead of UTC

バラよりiptables -m time -h

結論として:異なる時間に複数の転送ルールを追加できます。ただし、宛先が変更されるとTCPセッションが中断されます(例:ハウクラグ上記のように)

おすすめ記事