|
1 |
| -.. begin-intro |
2 |
| -
|
3 |
| -Starting in MongoDB 3.6, MongoDB binaries, :binary:`~bin.mongod` and |
4 |
| -:binary:`~bin.mongos`, bind to localhost by default. If the |
5 |
| -:setting:`net.ipv6` configuration file setting or the ``--ipv6`` |
6 |
| -command line option is set for the binary, the binary additionally binds |
7 |
| -to the localhost IPv6 address. |
8 |
| - |
9 |
| -.. end-intro |
10 |
| -
|
11 |
| -Previously, starting from MongoDB 2.6, only the binaries from the |
12 |
| -official MongoDB RPM (Red Hat, CentOS, Fedora Linux, and derivatives) |
13 |
| -and DEB (Debian, Ubuntu, and derivatives) packages bind to localhost by |
14 |
| -default. |
| 1 | +.. include:: /includes/warning-bind-ip-security-considerations.rst |
15 | 2 |
|
16 |
| -When bound only to the localhost, these MongoDB 3.6 binaries can only |
17 |
| -accept connections from clients (including :binary:`~bin.mongosh` and |
18 |
| -other members of your deployment in replica sets and sharded clusters) |
19 |
| -that are running on the same machine. Remote clients cannot connect to |
20 |
| -the binaries bound only to localhost. |
| 3 | +MongoDB binaries, :binary:`~bin.mongod` and :binary:`~bin.mongos`, bind |
| 4 | +to localhost by default. If the :setting:`net.ipv6` configuration file |
| 5 | +setting or the ``--ipv6`` command line option is set for the binary, |
| 6 | +the binary additionally binds to the localhost IPv6 address. |
21 | 7 |
|
22 |
| -.. begin-override |
| 8 | +By default :binary:`~bin.mongod` and :binary:`~bin.mongos` that are |
| 9 | +bound to localhost only accept connections from clients that are |
| 10 | +running on the same computer. This binding behavior includes |
| 11 | +:binary:`~bin.mongosh` and other members of your replica set or sharded |
| 12 | +cluster. Remote clients cannot connect to binaries that are bound only |
| 13 | +to localhost. |
23 | 14 |
|
24 |
| -To override and bind to other ip addresses, you can use the |
25 |
| -:setting:`net.bindIp` configuration file setting or the |
26 |
| -``--bind_ip`` command-line option to specify a list of hostnames or ip |
27 |
| -addresses. |
| 15 | +To override the default binding and bind to other IP addresses, use the |
| 16 | +:setting:`net.bindIp` configuration file setting or the ``--bind_ip`` |
| 17 | +command-line option to specify a list of hostnames or IP addresses. |
28 | 18 |
|
29 |
| -.. include:: /includes/warning-bind-ip-security-considerations.rst |
| 19 | +.. include:: /includes/warning-no-ip-addresses-in-split-horizons.rst |
30 | 20 |
|
31 | 21 | For example, the following :binary:`~bin.mongod` instance binds to both
|
32 | 22 | the localhost and the hostname ``My-Example-Associated-Hostname``, which is
|
33 |
| -associated with the ip address ``198.51.100.1``: |
| 23 | +associated with the IP address ``198.51.100.1``: |
34 | 24 |
|
35 | 25 | .. code-block:: none
|
36 | 26 |
|
37 | 27 | mongod --bind_ip localhost,My-Example-Associated-Hostname
|
38 | 28 |
|
39 | 29 | In order to connect to this instance, remote clients must specify
|
40 |
| -the hostname or its associated ip address ``198.51.100.1``: |
| 30 | +the hostname or its associated IP address ``198.51.100.1``: |
41 | 31 |
|
42 | 32 | .. code-block:: none
|
43 | 33 |
|
44 | 34 | mongosh --host My-Example-Associated-Hostname
|
45 | 35 |
|
46 | 36 | mongosh --host 198.51.100.1
|
47 | 37 |
|
48 |
| -.. end-override |
0 commit comments