Hi everyone,
I’m a CS teacher learning about lxd.
For an assignment to my students I need 10 containers running apache and ssh on public (static) IPs. I thought about aliasing the public IPs on the host interface and adding a proxy for each IP to each container, for ports 80 and 22, like this:
If that LXD host has an Ethernet connection to the LAN, then you (LXD admin) can use managed macvlan to assign IP address from the LAN.
See the release notes of LXD 4.4 on how to do this, LXD 4.4 has been released
There are other options but I think from what you described, the above approach is the simplest.
Thanks, It works and indeed it is extremely simple!
The host is Ubuntu 20.04; here’s what I did:
Updated LXD to 4.4: sudo snap refresh --channel=4.4/stable lxd
Created macvlan0 network on the host assigned to ens33: sudo lxc network create macvlan0 parent=ens33 --type=macvlan
Created an instance, connected it to the network: sudo lxc init ubuntu:20.04 ct1 sudo lxc config device add ct1 eth0 nic network=macvlan0 name=eth0 sudo lxc start ct1