iptables只允许特定的站点到特定的站点

我想允许某些IP地址在我的apache服务器( my.site.com )下运行。 我知道我可以使用Allow from 192.168.0但我想知道是否有可能通过iptables做到这一点,同时使用iptables规则login到my.site.com的请求。 那套规则是什么?

 #access control iptables -A INPUT -p tcp --dport 80 -s 192.168.0.0/24 -j ACCEPT iptables -A INPUT -p tcp --dport 80 -j DROP #loggin iptables -A INPUT -p tcp --dport 80 -m string --to 200 --string "GET /" --algo kmp -j LOG iptables -A INPUT -p tcp --dport 80 -m string --to 200 --string "POST /" --algo kmp -j LOG 

string匹配扩展将允许您对数据包的内容进行一些过滤,但是您最好在httpd中完成。