0
我有一个与iptables和字符串匹配的问题。我读过的大部分内容都会丢弃符合规则的数据包。当我用这个,iptable丢弃带有字符串“测试”iptables字符串匹配接受连接
iptables -A INPUT -p tcp --dport 80 -m string --string ! "test" --algo bm -j LOG --log-prefix ' INPUT TCP--- ' --log-level 4
iptables -A INPUT -p tcp --dport 80 -m string --string ! "test" --algo bm -j DROP
所以,当我去http://www.abc.com/?test,该连接不会通过任何连接。
我想要做的是相反的,我可以使用字符串匹配来批准连接吗?
iptables -A INPUT -p tcp --dport 80 -m string --string "test" --algo bm -j LOG --log-prefix ' INPUT TCP--- ' --log-level 4
iptables -A INPUT -p tcp --dport 80 -m string --string "test" --algo bm -j ACCEPT
iptables -A INPUT -p tcp --dport 80 -j DROP
我想只允许80端口是有它的单词测试,财产以后这样的连接... http://www.abc.com/?test
可以这样做?
谢谢你的帮助, 高尔基体
你能解释如何设置代理来做到这一点? – user969622
使用鱿鱼: acl blocktest url_regex测试 http_access拒绝blocktest –
我建议打开一个新的问题:) –