title: Using firewalld to only restrict specific ports between 2 servers and allow everything else
body: <p>I've never used firewalld before, and I'm being asked to set up some local firewall rules to allow/prevent specific traffic.</p>
  <p>Basically, I have some systems in a protected network. This network allows incoming traffic from a number of sources over a number of ports. Whatever else happens, I can't accidentally block any of the existing traffic.</p>
  <p>On top of that, there is one particular application running on 2 specific servers on this protected subnet and they talk to each other over 3 different tcp ports.</p>
  <p>The ask is that I don't block anything from anywhere except that, for these 3 ports, only these 2 servers should be able to communicate.</p>
  <p>Everything I've tried in firewalld seems to make it so that all traffic is allowed, or none, or only traffic to that port is allowed or not. But I can't figure out how to allow all traffic except X and only allow X between two specific IP's.</p>
  <p>I hope this all makes sense.</p>
  <hr />
  <p>Rule 1 --&gt; All traffic allowed except tcp ports 10000, 10010, 10020</p>
  <p>Rule 2 --&gt; Ports 10000, 10010, 10020 allowed between server1 and server2 only</p>
  <p>Rule 3 --&gt; Ports 10000, 10010, 10020 denied from all other sources</p>