小编Łuk*_*oda的帖子

在“路由”模式下设置的 LXC 容器中没有网络连接

我正在 Vagrant 中尝试 lxc/lxd,但我对它还很陌生。我设法创建正在运行的容器,但无法从其中 ping 任何内容(包括 8.8.8.8)。我可以从顶级非虚拟系统 ping 其 IP,但它拒绝 SSH 连接。我只能使用 直接从直接容器的主机(Vagrant)进入容器lxc exec my-container /bin/bash

我尝试在该routed模式下设置我的容器,但出于学习目的,我仍然需要它。不过 LXD/LXC 文档似乎有些缺乏。

我尝试遵循此说明:https://blog.simos.info/how-to-get-lxd-containers-get-ip-from-the-lan-with-routed-network/但它不起作用我到底。我可能会错过一些东西,因为我还不熟悉 Linux 网络。

我的 Vagrant 主机正在运行Ubuntu 20.04

我的 LXC 容器正在运行Debian 10

我的 Vagrant 主机上的 LXC 配置:

config:
  core.https_address: '[::]:8443'
  core.trust_password: true
networks: []
storage_pools:
- config:
    source: /home/luken/lxd-storage-pools
  description: ""
  name: default
  driver: dir
profiles:
- name: default
  config: {}
  description: ""
  devices:
    root:
      path: /
      pool: default
      type: disk
- …
Run Code Online (Sandbox Code Playgroud)

networking linux-networking lxc lxd

6
推荐指数
1
解决办法
8667
查看次数

标签 统计

linux-networking ×1

lxc ×1

lxd ×1

networking ×1