Update and rename firststeps-bind_to_multiple_addresses.md to firststeps-ip_bindings.md

Dieser Commit ist enthalten in:
André Peters 2020-03-17 11:35:08 +01:00 committet von GitHub
Ursprung 465b08ee8c
Commit eb2ca2cc0f
Es konnte kein GPG-SchlĂĽssel zu dieser Signatur gefunden werden
GPG-SchlĂĽssel-ID: 4AEE18F83AFDEB23
2 geänderte Dateien mit 71 neuen und 69 gelöschten Zeilen

Datei anzeigen

@ -1,69 +0,0 @@
By default mailcow listens on all addresses, this can be problematic if you have multiple IPs on the host and you are running services already on same ports mailcow uses.
This example will show how to bind services to 1 IPv4 address and 1 IPv6 address. Though this could be expanded to as many addresses as you want.
A `docker-compose.override.yml` file will be used instead of editing the `docker-compose.yml` file directly. This is to maintain updatability, as the `docker-compose.yml` file gets update regularly and your changes will be overwritten.
For this example the host will have the following addresses
`fd:0:0:0:0:0:0:1`
`fd:0:0:0:0:0:0:2`
`192.168.1.1`
`192.168.1.2`
##Changing Bindings In mailcow.conf
Say we wanted to bind all the services to `192.168.1.2` and `fd:0:0:0:0:0:0:2`. To do this we need to bind the following to a specific IP address in the `mailcow.conf`
HTTP_PORT=80
HTTP_BIND=192.168.1.2
HTTPS_PORT=443
HTTPS_BIND=192.168.1.2
SMTP_PORT=192.168.1.2:25
SMTPS_PORT=192.168.1.2:465
SUBMISSION_PORT=192.168.1.2:587
IMAP_PORT=192.168.1.2:143
IMAPS_PORT=192.168.1.2:993
POP_PORT=192.168.1.2:110
POPS_PORT=192.168.1.2:995
SIEVE_PORT=192.168.1.2:4190
DOVEADM_PORT=192.168.1.2:19991
##Overriding docker-compose.yml
Then we need to create `docker-compose.override.yml` with the following. This extends the configuration already defined in `docker-compose.yml`
version: '2.1'
services:
dovecot-mailcow:
ports:
- 'fd:0:0:0:0:0:0:2:143:143'
- 'fd:0:0:0:0:0:0:2:993:993'
- 'fd:0:0:0:0:0:0:2:110:110'
- 'fd:0:0:0:0:0:0:2:995:995'
- 'fd:0:0:0:0:0:0:2:4190:4190'
postfix-mailcow:
ports:
- 'fd:0:0:0:0:0:0:2:25:25'
- 'fd:0:0:0:0:0:0:2:465:465'
- 'fd:0:0:0:0:0:0:2:587:587'
nginx-mailcow:
ports:
- 'fd:0:0:0:0:0:0:2:80:80'
- 'fd:0:0:0:0:0:0:2:443:443'
## Restart Mailcow#
!!! warning
mailcow will fail to start or not start completely if you mess up the address bindings
To restart mailcow run the following
```
docker-compose stop
docker-compose up -d
```

Datei anzeigen

@ -0,0 +1,71 @@
!!! warning
Changing the binding does not affect source NAT. See [SNAT](https://mailcow.github.io/mailcow-dockerized-docs/firststeps-snat/) for required steps.
## IPv4 binding
To adjust one or multiple IPv4 bindings, open `mailcow.conf` and edit one, mulitple or all variables as per your needs:
```
# For technical reasons, http bindings are a bit different from other service bindings.
# You will find the following variables, separated by a bind address and its port:
HTTP_PORT=80
HTTP_BIND=0.0.0.0
HTTPS_PORT=443
HTTPS_BIND=0.0.0.0
# Other services are bound by using the following format:
# SMTP_PORT=25 equals to SMTP_PORT=0.0.0.0:25
# SMTP_PORT=1.2.3.4:25 will bind SMTP to the IP 1.2.3.4 on port 25
# doveadm, SQL as well as Solr are bound to local ports only, please do not change that, unless you know what you are doing.
SMTP_PORT=25
SMTPS_PORT=465
SUBMISSION_PORT=587
IMAP_PORT=143
IMAPS_PORT=993
POP_PORT=110
POPS_PORT=995
SIEVE_PORT=4190
DOVEADM_PORT=127.0.0.1:19991
SQL_PORT=127.0.0.1:13306
SOLR_PORT=127.0.0.1:18983
```
To apply your changes, run `docker-compose down` followed by `docker-compose up -d`.
## IPv6 binding
Changing IPv6 bindings is different from IPv4. Again, this has a technical background.
A `docker-compose.override.yml` file will be used instead of editing the `docker-compose.yml` file directly. This is to maintain updatability, as the `docker-compose.yml` file gets updated regularly and your changes will most likely be overwritten.
Edit to create a file `docker-compose.override.yml` with the following content. Its content will be merged with the productive `docker-compose.yml` file.
An imaginary IPv6 **2a00:dead:beef::abc** is given. The first suffix `:PORT1` defines the external port, while the second suffix `:PORT2` routes to the corresponding port inside the container and must not be changed.
```
version: '2.1'
services:
dovecot-mailcow:
ports:
- '2a00:dead:beef::abc:143:143'
- '2a00:dead:beef::abc:993:993'
- '2a00:dead:beef::abc:110:110'
- '2a00:dead:beef::abc:995:995'
- '2a00:dead:beef::abc:4190:4190'
postfix-mailcow:
ports:
- '2a00:dead:beef::abc:25:25'
- '2a00:dead:beef::abc:465:465'
- '2a00:dead:beef::abc:587:587'
nginx-mailcow:
ports:
- '2a00:dead:beef::abc:80:80'
- '2a00:dead:beef::abc:443:443'
```
To apply your changes, run `docker-compose down` followed by `docker-compose up -d`.