Update 22 June 2020 I have updated this post to be compatible with LXD 4.0. I also adapted it in order to create an empty profile that does only the macvlan stuff and is independent of the default profile. Finally, I am calling the profile macvlan
(previous name: lanprofile).
2020년 6월 22일 업데이트 이 게시물을 LXD 4.0과 호환되도록 업데이트했습니다. 또한 기본 프로필과 독립적인 macvlan 작업만 수행하는 빈 프로필을 만들도록 조정했습니다. 마지막으로, 이 프로필을 macvlan
라고 부릅니다(이전 이름: lanprofile).
WARNING #1: By using macvlan, your computer’s network interface will appear on the network to have more than one MAC address. This is fine for Ethernet networks. However, if your interface is a Wireless interface (with security like WPA/WPA2), then the access point will reject any other MAC addresses coming from your computer. Therefore, all these will not work in that specific case.
경고 #1: macvlan을 사용하면 컴퓨터의 네트워크 인터페이스가 네트워크에서 여러 개의 MAC 주소를 가진 것처럼 나타납니다. 이는 이더넷 네트워크에서는 괜찮습니다. 그러나 인터페이스가 무선 인터페이스(WPA/WPA2와 같은 보안이 있는 경우)인 경우, 액세스 포인트는 컴퓨터에서 오는 다른 MAC 주소를 거부합니다. 따라서 이러한 모든 경우는 특정 상황에서 작동하지 않습니다.
WARNING #2: If your host is in a virtual machine, then it is likely that the VM software will block the DHCP requests of the containers. There are options on both VMWare and Virtualbox to allow Promiscuous mode (somewhere in their Network settings). You need to enable that. Keep in mind that people reported success only on VMWare. Currently, on VirtualBox, you need to switch the network interface on the host into the PROMISC mode, as a workaround.
경고 #2: 호스트가 가상 머신에 있는 경우, VM 소프트웨어가 컨테이너의 DHCP 요청을 차단할 가능성이 높습니다. VMWare와 Virtualbox 모두에서 Promiscuous 모드를 허용하는 옵션이 있습니다(네트워크 설정의 어딘가에 있습니다). 이를 활성화해야 합니다. 사람들이 VMWare에서만 성공했다고 보고했다는 점을 염두에 두십시오. 현재 VirtualBox에서는 호스트의 네트워크 인터페이스를 PROMISC 모드로 전환해야 합니다.
In LXD terminology, you have the host and then you have the many containers on this host. The host is the computer where LXD is running. By default, all containers run hidden in a private network on the host. The containers are not accessible from the local network, nor from the Internet. However, they have network access to the Internet through the host. This is NAT networking.
LXD 용어에서 호스트가 있고 이 호스트에 여러 개의 컨테이너가 있습니다. 호스트는 LXD가 실행되고 있는 컴퓨터입니다. 기본적으로 모든 컨테이너는 호스트의 개인 네트워크에서 숨겨져 실행됩니다. 컨테이너는 로컬 네트워크나 인터넷에서 접근할 수 없습니다. 그러나 호스트를 통해 인터넷에 대한 네트워크 접근이 가능합니다. 이것이 NAT 네트워킹입니다.
How can we get some containers to receive an IP address from the LAN and be accessible on the LAN?
어떻게 하면 일부 컨테이너가 LAN에서 IP 주소를 받아 LAN에서 접근 가능하게 할 수 있을까요?
This can be achieved using macvlan (L2) virtual network interfaces, a feature provided by the Linux kernel.
이것은 리눅스 커널에서 제공하는 기능인 macvlan (L2) 가상 네트워크 인터페이스를 사용하여 달성할 수 있습니다.
In this post, we are going to create a new LXD profile and configure macvlan in it. Then, we launch new containers under the new profile, or attach existing containers to the new profile (so they get as well a LAN IP address).
이 게시물에서는 새로운 LXD 프로필을 만들고 그 안에 macvlan을 구성할 것입니다. 그런 다음, 새로운 프로필 아래에서 새로운 컨테이너를 시작하거나 기존 컨테이너를 새로운 프로필에 연결하여 LAN IP 주소를 받을 수 있도록 합니다.
Creating a new LXD profile for macvlan
macvlan을 위한 새로운 LXD 프로필 생성
Let’s see what LXD profiles are available.
LXD 프로필이 어떤 것이 있는지 살펴보겠습니다.
$ lxc profile list +------------+---------+ | NAME | USED BY | +------------+---------+ | default | 11 | +------------+---------+
There is a single profile, called default, the default profile. It is used by 11 LXD containers on this system.
이 시스템에는 기본 프로필이라고 불리는 단일 프로필이 있습니다. 이 프로필은 11개의 LXD 컨테이너에서 사용됩니다.
We create a new profile. The new profile is called macvlan.
새 프로필을 생성합니다. 새 프로필의 이름은 macvlan입니다.
$ lxc profile create macvlan Profile macvlan created $ lxc profile list +------------+---------+ | NAME | USED BY | +------------+---------+ | default | 11 | +------------+---------+ | macvlan | 0 | +------------+---------+
What are the default settings of a new profile?
새 프로필의 기본 설정은 무엇인가요?
$ lxc profile show macvlan config: {} description: "" devices: {} name: macvlan used_by: [] $
We need to add a nic with nictype macvlan
and parent to the appropriate network interface on the host and we are then ready to go. Let’s identify the correct parent, using the ip route command. This command shows the default network route. It also shows the name of the device (dev), which is in this case enp5s12. (Before systemd, those used to be eth0 or wlan0. Now, the name varies depending on the specific network cards).
우리는 nic 유형 macvlan
와 부모를 호스트의 적절한 네트워크 인터페이스에 추가해야 하며, 그러면 준비가 완료됩니다. ip route 명령을 사용하여 올바른 부모를 식별해 보겠습니다. 이 명령은 기본 네트워크 경로를 보여줍니다. 또한 이 경우 enp5s12인 장치(dev)의 이름도 보여줍니다. (systemd 이전에는 eth0 또는 wlan0이 사용되었습니다. 이제 이름은 특정 네트워크 카드에 따라 다릅니다).
$ ip route show default 0.0.0.0/0 default via 192.168.1.1 dev enp5s12 proto static metric 100
Now we are ready to add the appropriate device to the macvlan
LXD profile. We use the lxc profile device add command to add a device eth0 to the profile lanprofile. We set nictype to macvlan, and parent to enp5s12.
이제 적절한 장치를 macvlan
LXD 프로필에 추가할 준비가 되었습니다. lxc profile device add 명령을 사용하여 lanprofile 프로필에 eth0 장치를 추가합니다. nictype을 macvlan으로 설정하고, parent를 enp5s12로 설정합니다.
$ lxc profile device add macvlan eth0 nic nictype=macvlan parent=enp5s12 Device eth0 added to macvlan $ lxc profile show macvlan config: {} description: "" devices: eth0: nictype: macvlan parent: enp5s12 type: nic name: macvlan used_by: [] ubuntu@myvm:~$ $
Well, that’s it. We are now ready to launch containers using this new profile, and they will get an IP address from the DHCP server of the LAN.
그게 다입니다. 이제 이 새로운 프로필을 사용하여 컨테이너를 시작할 준비가 되었으며, 이들은 LAN의 DHCP 서버에서 IP 주소를 받을 것입니다.
Launching LXD containers with the new profile
새 프로필로 LXD 컨테이너 시작하기
Let’s launch two containers using the new macvlan profile and then check their IP address. We need to specify first the default
profile, and then the macvlan
profile. By doing this, the container will get the appropriate base configuration from the first profile, and then the networking will be overridden by the macvlan
profile.
새로운 macvlan 프로필을 사용하여 두 개의 컨테이너를 실행한 다음 IP 주소를 확인해 보겠습니다. 먼저 default
프로필을 지정한 다음 macvlan
프로필을 지정해야 합니다. 이렇게 하면 컨테이너는 첫 번째 프로필에서 적절한 기본 구성을 가져오고, 그 다음 macvlan
프로필에 의해 네트워킹이 재정의됩니다.
$ lxc launch ubuntu:18.04 net1 --profile default --profile macvlan Creating net1 Starting net1 $ lxc launch ubuntu:18.04 net2 --profile default --profile macvlan Creating net2 Starting net2 $ lxc list +------+---------+---------------------+------+-----------+-----------+ | NAME | STATE | IPV4 | IPV6 | TYPE | SNAPSHOTS | +------+---------+---------------------+------+-----------+-----------+ | net1 | RUNNING | 192.168.1.7 (eth0) | | CONTAINER | 0 | +------+---------+---------------------+------+-----------+-----------+ | net2 | RUNNING | 192.168.1.3 (eth0) | | CONTAINER | 0 | +------+---------+---------------------+------+-----------+-----------+ $
Both containers got their IP address from the LAN router. Here is the router administration screen that shows the two containers. I edited the names by adding LXD in the front to make them look nicer. The containers look and feel as just like new LAN computers!
두 컨테이너는 LAN 라우터에서 IP 주소를 받았습니다. 여기 두 컨테이너를 보여주는 라우터 관리 화면이 있습니다. 이름을 더 보기 좋게 만들기 위해 앞에 LXD를 추가하여 편집했습니다. 컨테이너는 마치 새로운 LAN 컴퓨터처럼 보이고 느껴집니다!
Let’s ping from one container to the other.
한 컨테이너에서 다른 컨테이너로 핑을 보내봅시다.
$ lxc exec net1 -- ping -c 3 192.168.1.7 PING 192.168.1.7 (192.168.1.7) 56(84) bytes of data. 64 bytes from 192.168.1.7: icmp_seq=1 ttl=64 time=0.064 ms 64 bytes from 192.168.1.7: icmp_seq=2 ttl=64 time=0.067 ms 64 bytes from 192.168.1.7: icmp_seq=3 ttl=64 time=0.082 ms --- 192.168.1.7 ping statistics --- 3 packets transmitted, 3 received, 0% packet loss, time 2036ms rtt min/avg/max/mdev = 0.064/0.071/0.082/0.007 ms
You can ping these containers from other computers on your LAN! But the host and these macvlan
containers cannot communicate over the network. This has to do with how macvlan works in the Linux kernel.
이 컨테이너들은 LAN의 다른 컴퓨터에서 핑을 보낼 수 있습니다! 그러나 호스트와 이 macvlan
컨테이너들은 네트워크를 통해 통신할 수 없습니다. 이는 macvlan이 리눅스 커널에서 작동하는 방식과 관련이 있습니다.
Troubleshooting 문제 해결
Help! I cannot ping between the host and the containers!
도와주세요! 호스트와 컨테이너 간에 핑을 보낼 수 없습니다!
To be able to get the host and containers to communicate with each other, you need some additional changes to the host in order to get added to the macvlan as well. It discusses it here, though I did not test because I do not need communication of the containers with the host. If you test it, please report below.
호스트와 컨테이너가 서로 통신할 수 있도록 하려면, macvlan에 추가되기 위해 호스트에 몇 가지 추가 변경이 필요합니다. 여기에서 논의되지만, 저는 호스트와의 컨테이너 통신이 필요하지 않기 때문에 테스트하지 않았습니다. 테스트하신 경우 아래에 보고해 주세요.
Help! I do not get anymore those net1.lxd, net2.lxd fancy hostnames!
도와주세요! 더 이상 net1.lxd, net2.lxd 멋진 호스트 이름을 받지 못하고 있습니다!
The default LXD DHCP server assigns hostnames like net1.lxd, net2.lxd to each container. Then, you can get the containers to communicate with each other using the hostnames instead of the IP addresses.
기본 LXD DHCP 서버는 각 컨테이너에 net1.lxd, net2.lxd와 같은 호스트 이름을 할당합니다. 그런 다음 IP 주소 대신 호스트 이름을 사용하여 컨테이너 간에 통신할 수 있습니다.
When using the LAN DHCP server, you would need to configure it as well to produce nice hostnames.
LAN DHCP 서버를 사용할 때, 멋진 호스트 이름을 생성하도록 구성해야 합니다.
Help! Can these new macvlan containers read my LAN network traffic?
도와주세요! 이 새로운 macvlan 컨테이너가 내 LAN 네트워크 트래픽을 읽을 수 있나요?
The new macvlan LXD containers (that got a LAN IP address) can only see their own traffic and also any LAN broadcast packets. They cannot see the traffic meant for the host, nor the traffic for the other containers.
새로운 macvlan LXD 컨테이너(랜 IP 주소를 받은)는 자신의 트래픽과 LAN 브로드캐스트 패킷만 볼 수 있습니다. 호스트를 위한 트래픽이나 다른 컨테이너를 위한 트래픽은 볼 수 없습니다.
Help! I get the error Error: Device validation failed “eth0”: Cannot use “nictype” property in conjunction with “network” property
도와주세요! Error: Device validation failed “eth0”: Cannot use “nictype” property in conjunction with “network” property
오류가 발생합니다
A previous version of this tutorial had the old style of how to add a device to a LXD profile. The old style was supposed to work in compatibility mode in newer versions of LXD. But at least in LXD 4.2 it does not, and gives the following error. You should not get this error anymore since I have updated the post. You may get an error if you are using a very old LXD. In that case, report back in the comments please.
이 튜토리얼의 이전 버전은 LXD 프로필에 장치를 추가하는 구식 방법을 가지고 있었습니다. 구식 방법은 최신 버전의 LXD에서 호환성 모드로 작동해야 했습니다. 그러나 LXD 4.2에서는 작동하지 않으며 다음과 같은 오류가 발생합니다. 제가 게시물을 업데이트했기 때문에 더 이상 이 오류가 발생하지 않아야 합니다. 매우 오래된 LXD를 사용하고 있다면 오류가 발생할 수 있습니다. 그런 경우에는 댓글로 알려주세요.
$ lxc profile device set macvlan eth0 nictype macvlan
Error: Device validation failed "eth0": Cannot use "nictype" property in conjunction with "network" property
$
Summary 요약
With this tutorial, you are able to create containers that get an IP address from the LAN (same source as the host), using macvlan.
이 튜토리얼을 통해 macvlan을 사용하여 LAN(호스트와 동일한 출처)에서 IP 주소를 받는 컨테이너를 생성할 수 있습니다.
A downside is that the host and these macvlan
containers cannot communicate over the network. For some, this is a neat advantage, because they shield the host from the containers.
단점은 호스트와 이러한 macvlan
컨테이너가 네트워크를 통해 통신할 수 없다는 것입니다. 일부에게는 이것이 호스트를 컨테이너로부터 보호하기 때문에 깔끔한 장점입니다.
The macvlan
containers are then visible on the LAN and work just like another LAN computer.
그 macvlan
컨테이너는 LAN에서 보이며 다른 LAN 컴퓨터처럼 작동합니다.
This tutorial has been updated with the newer commands to edit a LXD profile (lxc profile device add
). The older command now gives an error as you can see in the more recent comments below.
이 튜토리얼은 LXD 프로필을 편집하기 위한 최신 명령어로 업데이트되었습니다 ( lxc profile device add
). 이전 명령어는 아래의 최근 댓글에서 볼 수 있듯이 이제 오류를 발생시킵니다.
Yup, got it working using a public bridge! thank you so much.
네, 공개 브리지를 사용하여 작동하게 했습니다! 정말 감사합니다.
Just for info – using lxd to setup 3 ubuntu(focal) containers on a ubuntu server, to act as a moosefs filesystem, passing through the hosts 9 drives for storage.
정보를 위해 – 우분투 서버에서 3개의 우분투(focal) 컨테이너를 설정하기 위해 lxd를 사용하여 moosefs 파일 시스템으로 작동하며, 호스트의 9개 드라이브를 스토리지로 전달합니다.
Nearly finished, working very nicely. Looking fwd to testing performance.
거의 완료되었고, 매우 잘 작동하고 있습니다. 성능 테스트를 기대하고 있습니다.
Hello @ Blackpaw ,
안녕하세요 @ Blackpaw ,
I did the same with lightweigh VMs following this guide:
이 가이드를 따라 경량 VM에 대해서도 같은 작업을 했습니다:
https://nasilemaktech.com/guide-lizardfs-drive-level-redundancy/
..and was going to try with lxd containers.
..그리고 lxd 컨테이너로 시도할 예정이었습니다.
Is it something similar that you are doing?
당신이 하고 있는 것이 비슷한 것인가요?
Do you mind to share the setup?
설정을 공유해 주시겠어요?
Cheers, 건배,
Max 맥스
Radu 2021년 6월 3일 12:27
Simos, thank you for this excellent
How To
guide. I have successfully set up macvlan on my host running LXD 4.13. I am trying to create aTraefik
reverse proxy container that will expose services for the other containers, all running on macvlan. I am Not running Docker, and I do not want to, just the Traefik executable inside LXD container. I can connect from to the Traefik dashboard from any computer on my lan, but I cannot proxy to the services. Do you know if Traefik is supposed to work with LXD, especially macvlan? Kind regards, RaduSimos, 이 훌륭한
How To
가이드에 감사드립니다. 저는 LXD 4.13을 실행하는 호스트에서 macvlan을 성공적으로 설정했습니다. 저는 다른 컨테이너를 위해 서비스를 노출할Traefik
리버스 프록시 컨테이너를 만들려고 합니다. 저는 Docker를 실행하지 않고 싶고, LXD 컨테이너 내에서 Traefik 실행 파일만 사용하고 싶습니다. 저는 LAN의 어떤 컴퓨터에서든 Traefik 대시보드에 연결할 수 있지만, 서비스에 프록시할 수는 없습니다. Traefik이 LXD, 특히 macvlan과 함께 작동해야 하는지 아십니까? 친애하는, RaduSimos Xenitellis 2021년 6월 3일 17:28
Author 저자
Thank you Radu! 감사합니다, 라두!
Traefik supports dynamic configuration so that it works automatically without the need for configuration from the administrator’s side. However, it does not support LXD as a provider yet. Please see https://github.com/traefik/traefik/issues/2195 and https://doc.traefik.io/traefik/providers/overview/ (list of providers)
Traefik은 관리자의 구성 없이 자동으로 작동할 수 있도록 동적 구성을 지원합니다. 그러나 아직 LXD를 공급자로 지원하지 않습니다. https://github.com/traefik/traefik/issues/2195 및 https://doc.traefik.io/traefik/providers/overview/ (공급자 목록)를 참조하십시오.
Having said that, there is the option for static configuration. You would need to go through that route. Since you can access the dashboard, it means that there are no network issues.
그렇긴 하지만, 정적 구성을 선택할 수 있는 옵션이 있습니다. 그 경로를 따라가야 합니다. 대시보드에 접근할 수 있다는 것은 네트워크 문제가 없다는 것을 의미합니다.
Note that you can put traefik into a container, and then expose that container using a proxy device. As shown at https://blog.simos.info/how-to-use-the-lxd-proxy-device-to-map-ports-between-the-host-and-the-containers/
traefik을 컨테이너에 넣고, 그 컨테이너를 프록시 장치를 사용하여 노출할 수 있습니다. https://blog.simos.info/how-to-use-the-lxd-proxy-device-to-map-ports-between-the-host-and-the-containers/에서 보여준 것처럼.
When creating a proxy device, you can add the parameter
nat=true
so that LXD will create automatically for you the necessaryiptables/nftables
rules and would not need to spawn a proxy process.프록시 장치를 생성할 때, LXD가 자동으로 필요한
iptables/nftables
규칙을 생성하고 프록시 프로세스를 생성할 필요가 없도록nat=true
매개변수를 추가할 수 있습니다.Thanks a lot for these articles, they are very helpful! One thing I got very confused with, lost a lot of time on and I couldn’t get the result at the end – and it seems it is a technology limitation. And this is having my home server running on both WiFi and Ethernet, with ethernet being the preferred one. I managed to set this up with nmcli command, so far so good. But at the end there was no way how to get LXD working with WiFi – I will be using both containers and VMs. So macvlan doesn’t work, as per your #1 warning, but neither does bridge, as bridging a wifi interface is not possible by IEEE standards.
이 기사들에 대해 정말 감사합니다. 매우 유용합니다! 제가 매우 혼란스러웠던 한 가지는 많은 시간을 낭비했고 결국 결과를 얻지 못한 것입니다. 그리고 이것은 기술적 한계인 것 같습니다. 그리고 이것은 제 홈 서버가 WiFi와 이더넷 모두에서 작동하도록 설정하는 것인데, 이더넷이 선호되는 것입니다. 저는 nmcli 명령어로 이 설정을 완료했으니 지금까지는 잘 되고 있습니다. 하지만 마지막에 WiFi로 LXD를 작동시키는 방법이 없었습니다. 저는 컨테이너와 VM을 모두 사용할 예정입니다. 그래서 macvlan은 당신의 #1 경고에 따라 작동하지 않지만, 브리지는 IEEE 표준에 따라 WiFi 인터페이스를 브리징할 수 없기 때문에 작동하지 않습니다.
I found this info very misleading all over the internet and ended up burning a couple of days trying to solve this. If I’m mistaken I would be happy if someone can correct me, but also I would like to put it out there, that so far I couldn’t get and seems that it is not possible to get both your machine’s Ethernet and Wifi interfaces working side by side, according to connection, to provide LAN access for your LXD containers.
나는 이 정보가 인터넷 전반에 걸쳐 매우 오해의 소지가 있다고 생각하며, 이를 해결하려고 며칠을 낭비하게 되었다. 내가 잘못 알고 있다면 누군가 수정해 주면 기쁘겠지만, 지금까지 내 기계의 이더넷과 와이파이 인터페이스를 동시에 작동시켜 LXD 컨테이너에 LAN 액세스를 제공하는 것이 불가능한 것 같다는 점을 알리고 싶다.
Radu 2021년 6월 30일 16:23
Thank you Simos. I am using static configuration as suggested. If all my containers are using macvlan profile (including Traefik), do I still need to use LXD proxy device to map ports? I was hoping not to use bridge/nat configs. As mentioned previously, I can access the Treafik dashboard, routers and services have a green tick, but when I am trying to access the proxied service, I get
This site can’t be reached Check if there is a typo in guac.traefik. DNS_PROBE_FINISHED_NXDOMAIN
. All of this is running on my lan, nothing external. Any suggestions to what I’m doing wrong? Kind Regards.감사합니다, Simos. 제안하신 대로 정적 구성을 사용하고 있습니다. 모든 컨테이너가 macvlan 프로필을 사용하고 있다면(트래픽 포함), 여전히 포트를 매핑하기 위해 LXD 프록시 장치를 사용해야 하나요? 브리지/NAT 구성을 사용하지 않기를 바랐습니다. 이전에 언급했듯이, 트래픽 대시보드에 접근할 수 있고, 라우터와 서비스에 녹색 체크 표시가 있지만, 프록시된 서비스에 접근하려고 할 때
This site can’t be reached Check if there is a typo in guac.traefik. DNS_PROBE_FINISHED_NXDOMAIN
가 나타납니다. 이 모든 것은 제 LAN에서 실행되고 있으며, 외부와는 연결되어 있지 않습니다. 제가 잘못하고 있는 부분에 대한 제안이 있을까요? 친애하는 인사.Darold Lucus 2021년 7월 20일 17:07
This is all well and good, but you can still use the macvlan on 4.2 lxd. you need to remove the network stance in the profile before you can set the profile to macvlan. So lxc profile edit name of profile. Then remove the network stance and replace with nictype: macvlan, and parent: your ETH.
이것은 모두 좋지만, 여전히 4.2 lxd에서 macvlan을 사용할 수 있습니다. 프로필을 macvlan으로 설정하기 전에 프로필에서 네트워크 스탠스를 제거해야 합니다. 그래서 lxc profile edit 프로필 이름. 그런 다음 네트워크 스탠스를 제거하고 nictype: macvlan, parent: your ETH로 교체합니다.
EG:
nictype: macvlan
parent: enp2s0f1
After that you can just do a profile copy and the rest of your profiles will already be set to macvlan, you will need to set the parent nic on all of your copies though. “lxc profile device set profilename eth0 parent ‘your ETH’ “
그 후에는 프로필 복사를 하면 나머지 프로필이 이미 macvlan으로 설정됩니다. 그러나 모든 복사본에서 부모 NIC를 설정해야 합니다. “lxc profile device set profilename eth0 parent ‘your ETH’ “
Alexei 2021년 10월 26일 22:38
Great series of articles! Suppose I have a single network card in my host. Then I use a macvlan profile to create two separate LXD containers. Each of these containers gets their own mac address. This works fine.
훌륭한 기사 시리즈입니다! 호스트에 단일 네트워크 카드가 있다고 가정해 보겠습니다. 그런 다음 macvlan 프로필을 사용하여 두 개의 별도 LXD 컨테이너를 생성합니다. 이 컨테이너 각각은 고유한 MAC 주소를 갖습니다. 이것은 잘 작동합니다.
Now, in my network I have two VLANS: VLAN10 and VLAN20. I’d like one of the LXD containers to be on VLAN20 (say the second LXD container), and the LXD1 and the host on VLAN10. Is this possible?
이제 제 네트워크에는 두 개의 VLAN이 있습니다: VLAN10과 VLAN20. LXD 컨테이너 중 하나를 VLAN20에 두고 싶습니다(두 번째 LXD 컨테이너라고 가정할 때), 그리고 LXD1과 호스트는 VLAN10에 두고 싶습니다. 이게 가능할까요?
Miguel 2022년 10월 27일 13:41
Hello! I’m having some problems trying to set up my home server using LXD containers. I’m using docker inside my containers, using a “central” portainer and agents to control all my stacks.
안녕하세요! LXD 컨테이너를 사용하여 홈 서버를 설정하는 데 문제가 있습니다. 컨테이너 내부에서 도커를 사용하고 있으며, 모든 스택을 제어하기 위해 "중앙" 포테이너와 에이전트를 사용하고 있습니다.
The first problem is that in my SWAG (nginx+letsencrypt) the ip for all accesses is always the gateway of the docker bridge (you don’t know from where is the access). I was thinking that maybe I can fix it using the macvlan method described here, but then I’m unable to communicate from the macvlan container to the bridged (default) containers…
첫 번째 문제는 내 SWAG(nginx+letsencrypt)에서 모든 접근의 IP가 항상 도커 브리지의 게이트웨이라는 것입니다(어디서 접근하는지 알 수 없습니다). 여기서 설명된 macvlan 방법을 사용하여 이를 해결할 수 있을까 생각했지만, 그러면 macvlan 컨테이너에서 브리지(기본) 컨테이너와 통신할 수 없습니다…
My question is if using macvlan will fix my nginx issue, and how to reach the containers in the bridged network.
내 질문은 macvlan을 사용하면 내 nginx 문제를 해결할 수 있는지, 그리고 브리지 네트워크에서 컨테이너에 어떻게 접근할 수 있는지입니다.
RO 2023년 1월 16일 19:11
The mentioned blog about the host-guest connectivity (http://noyaudolive.net/2012/05/09/lxc-and-macvlan-host-to-guest-connection/) in the troubleshooting section, doesn’t exist anymore. Another blog refers to that fact and add its solution/version for it: https://limbenjamin.com/articles/macvlan-host-guest-connectivity.html
언급된 블로그는 호스트-게스트 연결( http://noyaudolive.net/2012/05/09/lxc-and-macvlan-host-to-guest-connection/)에 대한 문제 해결 섹션에서 더 이상 존재하지 않습니다. 다른 블로그는 그 사실을 언급하고 그에 대한 해결책/버전을 추가합니다: https://limbenjamin.com/articles/macvlan-host-guest-connectivity.html
Heiko 2023년 2월 21일 16:17
I just created a bridge br0 on the host and created a profile “bridged” like:
나는 호스트에서 브리지 br0를 만들고 "bridged"라는 프로필을 만들었습니다:
devices:
eth0:
name: eth0
nictype: bridged
parent: br0
type: nic
so I may choose on which network the container should start by adding the profile.
그래서 프로필을 추가하여 컨테이너가 시작할 네트워크를 선택할 수 있습니다.
What is the benefit of using the macvlan aproach?
macvlan 접근 방식을 사용하는 이점은 무엇인가요?