Hi everyone,
I’m new in this forum but I’m not new to using lxc. Previously i’ve used lxc with very basic command for test only, now i need to use it for production, Never had problems, i’ve always had network on my container but now i need to start a public service on every container. Service have to use single port to run but when i run it i can’t see it outside my VPS.
I use Ubuntu 18.04 on OVH VPS, i create Ubuntu 16.04 container with default profile and default lxd init settings (i just press Enter during init,k using “dir” option only)
My “lxc list” command return this:
(Run on default profile, It have network but i can’t use service outside)
±-----±--------±---------------------±----------------------------------------------±-----------±----------+
| NAME | STATE | IPV4 | IPV6 | TYPE | SNAPSHOTS |
±-----±--------±---------------------±----------------------------------------------±-----------±----------+
| TEST | RUNNING | 10.223.120.64 (eth0) | fd42:97e9:56da:d0c1:216:3eff:fe90:eef9 (eth0) | PERSISTENT | 0 |
±-----±--------±---------------------±----------------------------------------------±-----------±----------+
Then i’ve modified default profile:
(With this i don’t have network on my container. i can’t ping domain and i can’t ping ip address)
FROM
config: {}
description: Default LXD profile
devices:
eth0:
name: eth0
nictype: bridged
parent: lxdbr0
type: nic
root:
path: /
pool: default
type: disk
name: default
used_by:
containers/TEST
TO
config: {}
description: Default LXD profile
devices:
eth0:
name: eth0
nictype: macvlan #<--------------------MODIFIED
parent: ens3 #<--------------------MODIFIED
type: nic
root:
path: /
pool: default
type: disk
name: default
used_by:
containers/TEST
I’ve used macvlan and added ens3 (which uses the public ip of my vps in ifconfig:
ens3: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet XX.XX.XX.XXX netmask 255.255.255.255 broadcast 0.0.0.0
lo: flags=73<UP,LOOPBACK,RUNNING> mtu 65536
inet 127.0.0.1 netmask 255.0.0.0
lxdbr0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 10.223.120.1 netmask 255.255.255.0 broadcast 0.0.0.0
I searched in the forum, on github and on google without results, i think the problem is in default setting on lxd init
I hope there is someone who can help me, if I have news I will update the post.
I would like to congratulate those who created and support this project, it is a holy hand.