In general, I’m trying for the first time to touch lxc containers and create them. It seems like everything is clear, but I have a snag with the network setup.
I have an IP: 212.7.201.17/26 which I want to use on the container
Here is the configuration of the bridge
# lxc network show lxdbr0
config:
ipv4.address: 10.74.168.1/24
ipv4.nat: "true"
ipv6.address: fd42:4ce7:cc43:7ee::1/64
ipv6.nat: "true"
description: ""
name: lxdbr0
type: bridge
used_by:
- /1.0/instances/utilites-container
- /1.0/profiles/default
managed: true
status: Created
locations:
Next, I created lxc myself and manually assign IP in ifcfg-eth0:
DEVICE=eth0
BOOTPROTO=none
ONBOOT=yes
IPADDR=212.7.201.17
PREFIX=26
GATEWAY=212.7.201.62
DNS1=8.8.8.8
DNS2=8.8.4.4
HOSTNAME=utilites-container
TYPE=Ethernet
MTU=
DHCP_HOSTNAME=utilites-container
IPV6INIT=yes
default lxc settings
cat /etc/lxc/default.conf
lxc.net.0.type = empty
lxc.apparmor.profile = generated
lxc.apparmor.allow_nesting = 1
Current network conf on server
# cat /etc/network/interfaces
# 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 primary network interface
allow-hotplug enp2s0f0
iface enp2s0f0 inet static
address 212.7.***.38/26
gateway 212.7.***.62
But nothing worked. What am I missing? Where did I make a mistake or did not configure it?
Never did it manually.