1

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?

  • Just use RELATED/ESTABLISHED. – Chris Down Oct 4 '14 at 3:07
  • @ChrisDown ok, so there is no actual INITIALIZED state? RELATED/ESTABLISHED should cover the INITIALIZED state, right? – SSF Oct 4 '14 at 3:12
  • @TylerMaginnis that's actually a nice tool, thanks. – SSF Oct 4 '14 at 3:15
0

You can try adding the following rules to your iptables firewall:

$ 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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.