This will be long …
I have a dedicated server with 1 public IP, also I bought 2 more public IP with virtual MAC address (it can be generated at providers webpage).
First time when I made a setup of 2 containers with those later bought IP-s worked fine about 1 month, then came a restart and the containers never started again. Some device was missing.
I purged, reinstalled LXD, also tried with snap more than 20 times … could not made to work again.
Now from container I can’t ping anything, and it can’t be reached from public side, although it worked (one month with this config, until reboot).
What am I doing wrong ???
This is what I have now:
lxc profile list
+---------+---------+
| NAME | USED BY |
+---------+---------+
| default | 0 |
+---------+---------+
| macvlan | 1 |
+---------+---------+
lxc list
+-------+---------+---------------------+------+------------+-----------+
| NAME | STATE | IPV4 | IPV6 | TYPE | SNAPSHOTS |
+-------+---------+---------------------+------+------------+-----------+
| w3cos | RUNNING | 51.77.83.244 (eth0) | | PERSISTENT | 0 |
+-------+---------+---------------------+------+------------+-----------+
lxc profile show macvlan
config: {}
description: Default LXD profile
devices:
eth0:
name: eth0
nictype: macvlan
parent: eno1
type: nic
root:
path: /
pool: newspool
type: disk
name: macvlan
used_by:
- /1.0/containers/w3cos
lxc config show --expanded w3cos
architecture: x86_64
config:
image.architecture: amd64
image.description: ubuntu 18.04 LTS amd64 (release) (20200519.1)
image.label: release
image.os: ubuntu
image.release: bionic
image.serial: "20200519.1"
image.version: "18.04"
volatile.base_image: 70d3dcaabcffb1aa1644d0ce866efcb141742179e94ad72aefb8d3502338a71f
volatile.eth0.hwaddr: 02:00:00:81:0e:ec
volatile.idmap.base: "0"
volatile.idmap.next: '[{"Isuid":true,"Isgid":false,"Hostid":100000,"Nsid":0,"Maprange":65536},
{"Isuid":false,"Isgid":true,"Hostid":100000,"Nsid":0,"Maprange":65536}]'
volatile.last_state.idmap: '[{"Isuid":true,"Isgid":false,"Hostid":100000,"Nsid":0,"Maprange":65536},
{"Isuid":false,"Isgid":true,"Hostid":100000,"Nsid":0,"Maprange":65536}]'
volatile.last_state.power: RUNNING
devices:
eth0:
name: eth0
nictype: macvlan
parent: eno1
type: nic
root:
path: /
pool: newspool
type: disk
ephemeral: false
profiles:
- macvlan
stateful: false
description: ""
In container:
cat /etc/netplan/50-cloud-init.yaml
network:
version: 2
ethernets:
eth0:
dhcp4: no
dhcp6: no
addresses:
- 51.77.83.244/32
#gateway4: 54.36.111.254
nameservers:
addresses:
- 213.186.33.99
- 8.8.8.8
routes:
- to: 0.0.0.0/0
via: 51.77.83.244
on-link: true
In host:
ip a
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
inet 127.0.0.1/8 scope host lo
valid_lft forever preferred_lft forever
inet6 ::1/128 scope host
valid_lft forever preferred_lft forever
2: eno1: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP group default qlen 1000
link/ether a4:bf:01:2e:d7:46 brd ff:ff:ff:ff:ff:ff
inet 54.36.111.158/24 brd 54.36.111.255 scope global eno1
valid_lft forever preferred_lft forever
inet6 2001:41d0:700:119e::/64 scope global
valid_lft forever preferred_lft forever
inet6 fe80::a6bf:1ff:fe2e:d746/64 scope link
valid_lft forever preferred_lft forever
3: eno2: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN group default qlen 1000
link/ether a4:bf:01:2e:d7:47 brd ff:ff:ff:ff:ff:ff