I am deploying a honeypot (Ubuntu 18.04) using LXD containers (Ubuntu 18.04, too).
I have the honeypot server at 192.168.1.22/24, which runs lxd container that provides SSH service.
I have configured it so that host’s tcp:22 traffic will be forwarded to the container’s tcp:22, where the SSH service runs.
It works just fine so far, however, to emulate the host as much as possible, I want ‘ifconfig/ip address’ command inside the container to return 192.168.1.22/24 (same as the actual host) as the configured IP address, while maintain functional network access (it needs to provide valid SSH service after all).
I have tried to hook up the container with the lxdbr0 bridge, and manipulating the lxdbr0 does not yield the desired result.
I thought this was possible by having the container at 192.168.1.22/24, then traffic from container will be NAT’d by lxdbr0, which then gets out from the host’s NIC. However, I have not been able to
- configure the lxdbr0 to have, say 192.168.2.2/24, and configure the container to have 192.168.1.22/24, because after I set lxdbr0 to 192.168.2.2/24, the container always keep 192.168.2.x/24 address. I wasn’t able to overwrite it.
- configure static nat on lxdbr0. I have not figured out how to do that at all.
Any help is appreciated!