I am struggling to display clients WAN-IP to my containers. I can connect to them without trouble from WAN, but I am unable to see the client-ip that conencts in the logs. This breaks basic security-settings like fail2ban, hostsdeny, blocklists, etc.
If I set up a proxy-device witht the proxy-pass=true setting enabled, my conenctions fail (tested with a simple xmpp-server and a simple ssh-server). If I disable proxy-pass they work flawlessly, but logging shows 127.0.0.1
Question: what would be the most simple way to accomplish both of this:
A) forward incoming WAN traffic on a specific port to a specific container
B) make the connecting clients IP visible in the containers logs (instead of 127.0.0.1)
Simple example: basic ssh-server “mycontainer” listening on port 55444, internal LXD LAN IP is 10.242.191.102
Currently my LXD network settings are:
+---------+----------+---------+-----------------+---------------------------+-------------+---------+---------+
| NAME | TYPE | MANAGED | IPV4 | IPV6 | DESCRIPTION | USED BY | STATE |
+---------+----------+---------+-----------------+---------------------------+-------------+---------+---------+
| eno1 | physical | NO | | | | 0 | |
+---------+----------+---------+-----------------+---------------------------+-------------+---------+---------+
| enp2s0 | physical | NO | | | | 0 | |
+---------+----------+---------+-----------------+---------------------------+-------------+---------+---------+
| lxbriso | bridge | YES | 10.242.191.1/24 | fd42:3f60:b2e8:e797::1/64 | | 20 | CREATED |
+---------+----------+---------+-----------------+---------------------------+-------------+---------+---------+
| lxdbr0 | bridge | YES | 10.162.190.1/24 | fd42:dd78:6fbb:a515::1/64 | | 1 | CREATED |
+---------+----------+---------+-----------------+---------------------------+-------------+---------+---------+
| wlp3s0 | physical | NO | | | | 0 | |
+---------+----------+---------+-----------------+---------------------------+-------------+---------+---------+
Network config for specified container (without adding proxy-device)
devices:
eth0:
ipv4.address: 10.242.191.102
name: eth0
network: lxbriso
security.port_isolation: "true"
type: nic
Any help very much appreciated. I browsed the docu about devices, proxy and NAT, but didn’t succeed in solving my issue.