0

im currently setting up an mailcow instance. My plan is to give the server a public ip-address alongside with an internal ip-address. The mailserver itself should use the public-address while the webinterface should be only accessable via the internal interface.

My network-configuration for it looks like the following:

# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).

source /etc/network/interfaces.d/*

# The loopback network interface
auto lo
iface lo inet loopback

# The external network interface
#auto ens18
allow-hotplug ens18
iface ens18 inet static
        address X.X.X.X
        netmask 255.255.255.192
        gateway X.X.X.1

iface ens18 inet6 static
        address X:X:X::X
        netmask 48
        gateway fe80::1

allow-hotplug ens19
iface ens19 inet static
        address X.X.X.21
        netmask 255.255.255.0
        post-up ip route add X.X.X.0/24 dev ens19 src X.X.X.21 table rt2
        post-up ip route add default via X.X.X.1 dev ens19 table rt2
        post-up ip rule add from X.X.X.21/32 table rt2
        post-up ip rule add to X.X.X.21/32 table rt2

The mailcow is set up via the normal installation-instructions, like described here

Sadly Im not able to connect to the mailcow-container via the internal ip-address. I also tried to set the internal X.X.X.21-ip-address as host for the webserver via the mailcow-conf, but still it does not work.

Setting iptable-rules to forward the traffic also have not worked until know. Do you maybe have an idea why docker is not using the gateway which is set via iproute2, while pinging into the internal network just works fine from the host itself?

0 Answers0