@@ -72,7 +72,7 @@ as standalone instances or as part of a :term:`replica set`.
7272The goal of this pattern is to explicitly allow traffic to the
7373:program:`mongod.exe` instance from the application server.
7474
75- .. code-block:: netsh
75+ .. code-block:: bat
7676
7777 netsh advfirewall firewall add rule name="Open mongod port 27017" dir=in action=allow protocol=TCP localport=27017
7878
@@ -84,22 +84,22 @@ allows the application server to connect to the
8484an entire application rather than to a specific port, as in the
8585following example:
8686
87- .. code-block:: netsh
87+ .. code-block:: bat
8888
8989 netsh advfirewall firewall add rule name="Allowing mongod" dir=in action=allow program=" C:\mongodb\bin\mongod.exe"
9090
9191You can allow all access for a :program:`mongos.exe` server, with the
9292following invocation:
9393
94- .. code-block:: netsh
94+ .. code-block:: bat
9595
9696 netsh advfirewall firewall add rule name="Allowing mongos" dir=in action=allow program=" C:\mongodb\bin\mongos.exe"
9797
9898Traffic to and from ``mongos.exe`` Instances
9999~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
100100
101101:program:`mongos.exe` instances provide query routing for
102- :term:`sharded clusters`. Clients connect to :program:`mongos.exe`
102+ :term:`sharded clusters <sharded cluster> `. Clients connect to :program:`mongos.exe`
103103instances, which behave from the client's perspective as
104104:program:`mongod.exe` instances. In turn, the :program:`mongos.exe`
105105connects to all :program:`mongod.exe` instances that are components of
@@ -109,7 +109,7 @@ Use the same :guilabel:`Windows Firewall` command to allow traffic to
109109and from these instances as you would from the :program:`mongod.exe`
110110instances that are members of the replica set.
111111
112- .. code-block:: netsh
112+ .. code-block:: bat
113113
114114 netsh advfirewall firewall add rule name="Open mongod shard port 27018" dir=in action=allow protocol=TCP localport=27018
115115
@@ -124,7 +124,7 @@ option. [#config-option]_ Configuration servers listen for connections on port
124124config server to allow incoming and outgoing connection on port
125125``27019``, for connection to the other config servers.
126126
127- .. code-block:: netsh
127+ .. code-block:: bat
128128
129129 netsh advfirewall firewall add rule name="Open mongod config svr port 27019" dir=in action=allow protocol=TCP localport=27019
130130
@@ -133,7 +133,7 @@ all of the :program:`mongos.exe` instances in the cluster *and* all
133133:program:`mongod.exe` instances in the cluster. Add rules that
134134resemble the following:
135135
136- .. code-block:: netsh
136+ .. code-block:: bat
137137
138138 netsh advfirewall firewall add rule name="Open mongod config svr inbound" dir=in action=allow protocol=TCP remoteip=<ip-address> localport=27019
139139
@@ -152,7 +152,7 @@ For shard servers, running as :option:`mongod --shardsvr`
152152:setting:`shardsvr` is ``27018``, you must configure the following
153153:guilabel:`Windows Firewall` rules to allow traffic to and from each shard:
154154
155- .. code-block:: netsh
155+ .. code-block:: bat
156156
157157 netsh advfirewall firewall add rule name="Open mongod shardsvr inbound" dir=in action=allow protocol=TCP remoteip=<ip-address> localport=27018
158158 netsh advfirewall firewall add rule name="Open mongod shardsvr outbound" dir=out action=allow protocol=TCP remoteip=<ip-address> localport=27018
@@ -176,7 +176,7 @@ Create a rule that resembles the following, and replace the
176176``<ip-address>`` with the address of the config servers and the
177177:program:`mongos.exe` instances:
178178
179- .. code-block:: netsh
179+ .. code-block:: bat
180180
181181 netsh advfirewall firewall add rule name="Open mongod config svr outbound" dir=out action=allow protocol=TCP remoteip=<ip-address> localport=27018
182182
@@ -200,7 +200,7 @@ Provide Access For Monitoring Systems
200200#. If your monitoring system needs access the HTTP interface, insert
201201 the following rule to the chain:
202202
203- .. code-block:: netsh
203+ .. code-block:: bat
204204
205205 netsh advfirewall firewall add rule name="Open mongod HTTP monitoring inbound" dir=in action=allow protocol=TCP remoteip=<ip-address> localport=28017
206206
@@ -214,14 +214,14 @@ Provide Access For Monitoring Systems
214214 For shard server :program:`mongod.exe` instances running with
215215 :setting:`shardsvr`, the rule would resemble the following:
216216
217- .. code-block:: netsh
217+ .. code-block:: bat
218218
219219 netsh advfirewall firewall add rule name="Open mongos HTTP monitoring inbound" dir=in action=allow protocol=TCP remoteip=<ip-address> localport=28018
220220
221221 For config server :program:`mongod.exe` instances running with
222222 :setting:`configsvr`, the rule would resemble the following:
223223
224- .. code-block:: netsh
224+ .. code-block:: bat
225225
226226 netsh advfirewall firewall add rule name="Open mongod configsvr HTTP monitoring inbound" dir=in action=allow protocol=TCP remoteip=<ip-address> localport=28019
227227
@@ -238,7 +238,7 @@ Delete all *Windows Firewall* Rules
238238
239239To delete the firewall rule allowing :program:`mongod.exe` traffic:
240240
241- .. code-block:: netsh
241+ .. code-block:: bat
242242
243243 netsh advfirewall firewall delete rule name="Open mongod port 27017" protocol=tcp localport=27017
244244
@@ -249,7 +249,7 @@ List All *Windows Firewall* Rules
249249
250250To return a list of all :guilabel:`Windows Firewall` rules:
251251
252- .. code-block:: netsh
252+ .. code-block:: bat
253253
254254 netsh advfirewall firewall show rule name=all
255255
@@ -258,7 +258,7 @@ Reset *Windows Firewall*
258258
259259To reset the :guilabel:`Windows Firewall` rules:
260260
261- .. code-block:: netsh
261+ .. code-block:: bat
262262
263263 netsh advfirewall reset
264264
@@ -270,14 +270,14 @@ import firewall systems from different servers) rules very easily on Windows:
270270
271271Export all firewall rules with the following command:
272272
273- .. code-block:: netsh
273+ .. code-block:: bat
274274
275275 netsh advfirewall export "C:\temp\MongoDBfw.wfw"
276276
277277Replace ``"C:\temp\MongoDBfw.wfw"`` with a path of your choosing. You
278278can use a command in the following form to import a file created using
279279this operation:
280280
281- .. code-block:: netsh
281+ .. code-block:: bat
282282
283283 netsh advfirewall import "C:\temp\MongoDBfw.wfw"
0 commit comments