Skip to content

Commit a0d916e

Browse files
author
markofu
committed
Modifying the default iptables policy section
1 parent 858693a commit a0d916e

File tree

1 file changed

+19
-13
lines changed

1 file changed

+19
-13
lines changed

draft/tutorial/configure-linux-iptables-firewall.txt

Lines changed: 19 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -10,19 +10,6 @@ Input: filters traffic destined for the firewall
1010

1111
Output: filters traffic from the firewall
1212

13-
By default, ``iptables`` allows all connections so it's a good idea
14-
to change the default chain policy to DROP:
15-
16-
.. code-block:: sh
17-
18-
iptables -P INPUT DROP
19-
20-
iptables -P OUTPUT DROP
21-
22-
This ensures that any traffic to/from the :program:`mongod` server has
23-
to be explicitly allowed. Be careful when executing these commands that
24-
you do not lose access to the server.
25-
2613
Traffic to/from a Standalone MongoDB Instance or Replica-Set
2714
MongoDB Instance (mongod)
2815

@@ -103,6 +90,25 @@ In a sharded infrastructure, the :program:`mongos` router needs
10390
to connect to :program:`mongod` shard servers and the shard servers
10491
need to connect and communicate amongst themselves.
10592

93+
94+
Default Policy
95+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
96+
97+
By default, ``iptables`` allows all connections so it's a good idea
98+
to change the default chain policy to DROP:
99+
100+
.. code-block:: sh
101+
102+
iptables -P INPUT DROP
103+
104+
iptables -P OUTPUT DROP
105+
106+
107+
This ensures that any traffic to/from the :program:`mongod` server has
108+
to be explicitly allowed. Be careful when executing these commands that
109+
you do not lose access to the server, i.e. ensure you do this on a
110+
console connection or already have remote-access iptables rules.
111+
106112
Back-Out & Flush iptables rules
107113
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
108114

0 commit comments

Comments
 (0)