LXD. Correct IP configuration for the container
Budget: €8 – €30 EUR
Faced the problem of an additional IP for the container, so that the container itself was visible not only from the host.
Provider: OVH. System: Debian 11
I have an additional IP address with a MAC address
91.xx.xx.xx - 02:xx:xx:xx:xx:xx
Next, I created a bridge with the primary IP
# Include files from /etc/network/interfaces.d:
# source-directory /etc/network/interfaces.d
auto lo
iface lo inet loopback
auto eno1
iface eno1 inet manual
auto br0
iface br0 inet static
bridge_ports eno1
address 162.xx.xx.xx
gateway 162.xx.xx.xx
netmask 255.xx.xx.xx
dns-nameservers 8.8.8.8 1.1.1.1
hwaddress ether d0:xx:xx:xx:xx:xx
bridge_stp off
bridge_waitport 0
bridge_fd 0
Afterwards, I tried to create a container and assign additional ones there. IP so that it can be accessed externally.
I had many attempts, I tried both routed, bridged, macvlan. These are the commands I tried
lxc config device add test eth1 nic nictype=routed parent=br0 ipv4.address=91.xx.xx.xx
lxc config device add test eth1 nic nictype=macvlan parent=br0 hwaddr=02:xx:xx:xx:xx:xx
lxc config device add test eth1 nic nictype=bridged parent=br0 ipv4.address=91.xx.xx.xx
But nothing worked, the maximum result was the IP responding to the ping from the hos.
So where is my config error? How to correctly assign an IP for the container so that I can join the container not only from under the host?
Provider: OVH. System: Debian 11
I have an additional IP address with a MAC address
91.xx.xx.xx - 02:xx:xx:xx:xx:xx
Next, I created a bridge with the primary IP
# Include files from /etc/network/interfaces.d:
# source-directory /etc/network/interfaces.d
auto lo
iface lo inet loopback
auto eno1
iface eno1 inet manual
auto br0
iface br0 inet static
bridge_ports eno1
address 162.xx.xx.xx
gateway 162.xx.xx.xx
netmask 255.xx.xx.xx
dns-nameservers 8.8.8.8 1.1.1.1
hwaddress ether d0:xx:xx:xx:xx:xx
bridge_stp off
bridge_waitport 0
bridge_fd 0
Afterwards, I tried to create a container and assign additional ones there. IP so that it can be accessed externally.
I had many attempts, I tried both routed, bridged, macvlan. These are the commands I tried
lxc config device add test eth1 nic nictype=routed parent=br0 ipv4.address=91.xx.xx.xx
lxc config device add test eth1 nic nictype=macvlan parent=br0 hwaddr=02:xx:xx:xx:xx:xx
lxc config device add test eth1 nic nictype=bridged parent=br0 ipv4.address=91.xx.xx.xx
But nothing worked, the maximum result was the IP responding to the ping from the hos.
So where is my config error? How to correctly assign an IP for the container so that I can join the container not only from under the host?