I have a unique situation. Let's say my webserver ( e.g. 10.0.0.2) is connected to eth0 of my firewall (gw 10.0.0.1). A local network (192.168.0.0/24) is also connected to eth1 (192.168.0.1/24) of my firewall. Now I want to allow traffic from web server initialized from internal network. How should I use iptables command to do this? Is there a --state option that specifies INITIALIZED state?
You can try adding the following rules to your
$ sudo iptables -A INPUT -p tcp --dport 80 -s 192.168.0.0/24 -m state \ --state NEW,ESTABLISHED -j ACCEPT $ sudo iptables -A OUTPUT -p tcp --sport 80 -d 192.168.0.0/24 -m state \ --state ESTABLISHED -j ACCEPT