-2

Hi i want to allow only one network say 10.10.0.0 to access my varnish edge cache server at 192.168.1.10:80 port also block other 80 port request but the problem is cache server points to a origin server which listen on 80 port in in 192.168.2.0 network.

How could i enable only these two networks to request and fetch inside and output 80 port connections

See attached image:

enter image description here

Gerald Schneider
  • 23,274
  • 8
  • 57
  • 89
Leo
  • 11
  • 2

1 Answers1

0

Well, you should add to iptables rules on 192.168.1.10 this rules:

-A OUTPUT -d 192.168.2.0/24 -p tcp -m tcp --dport 80 -m state --state NEW,ESTABLISHED -j ACCEPT
-A OUTPUT -p tcp -m tcp --sport 80 -m state --state NEW,ESTABLISHED -j ACCEPT
-A INPUT -s 10.10.0.0/24 -p tcp -m tcp --dport 80 -m state --state ESTABLISHED -j ACCEPT
-A INPUT -s 192.168.2.0/24 -p tcp -m tcp --sport 80 -m state --state ESTABLISHED -j ACCEPT
Alexander Tolkachev
  • 4,608
  • 3
  • 14
  • 23