LoginSignup
3
2

More than 3 years have passed since last update.

iptablesで設定するファイヤーウォールで、ポート番号を範囲指定する

Posted at

はじめに

今までiptablesでポート番号の口を空ける際に、1ポートづつスクリプトで空けてたため凄く設定に時間がかかっていました。
目に余ったのでググったら普通にやり方があったので覚書

ポートの範囲は:で指定

通常のこんな風にdportにポート番号を1つ指定する代わりに、

iptables -A INPUT -p udp --dport 2085 -j ACCEPT

:でくくった範囲指定をします。

#i=2085, ..., 2900に設定するのと同じ働き
iptables -A INPUT -p udp --dport 2085:2900 -j ACCEPT

参考

Turbolinux 11 Server: ユーザーガイド > 第 22章パケットフィルタリングと NAT > 22.2. iptables のコマンド書式

3
2
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
3
2