TCP
--protocol tcp [options]
--protocol tcp [options]--protocol可以缩写为-p(注意不能用--match tcp)。可用的options有
[!] --source-port port[:port]指定源端口或源端口范围,
--source-port可以简写为--sport。前面加!表示“源端口不在port[:port]的范围内”[!] --destination-port port[:port]指定目标端口或目标端口范围,
--destionation-port可简写为--dport。前面加!表示“目的端口不在port[:port]的范围内”
示例
扔掉协议为TCP、源端口为80的包
iptables -t filter -A INPUT --protocol tcp --sport 80 -j DROP扔掉协议为TCP、目标端口为80的包
iptables -t filter -A INPUT --protocol tcp --dport 80 -j DROP扔掉协议为TCP、源端口为80到90的包
iptables -t filter -A INPUT --protocol tcp --sport 80:90 -j DROPLast updated
Was this helpful?