如何配置Docker容器以从ESX上运行的dhcp服务器获取DHCP IP / s [英] How to configure a Docker container for acquiring DHCP IP/s from dhcp server running on ESX

查看:401
本文介绍了如何配置Docker容器以从ESX上运行的dhcp服务器获取DHCP IP / s的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的主机是在ESX服务器上运行的SLES12 VM。 VM Host具有从ESX上运行的DHCP服务器获取DHCP IP的接口。

My host is SLES12 VM running on an ESX server. VM Host has interfaces which acquire DHCP IPs from the DHCP server running on ESX.

在我的docker容器中(docker image:opensuse),我正在运行NFS服务器,因此需要外部访问。 我希望容器从运行在ESX上的dhcp服务器获取dhcp IP(就像我的主机VM一样)。

In my docker container (docker image: opensuse) I am running a NFS server and hence need external access. I want the container to acquire dhcp IP from the dhcp server running on ESX (just like my Host VM gets).

我已经尝试了< a href = https://github.com/jpetazzo/pipework rel = noreferrer>管道,但无法正常运行。这是我所做的:

I have tried pipework but could not get it working. Here is what I did:


  1. 在ESX上启用混杂模式。创建了新的网桥(br1),并将

    附加到主机接口eth0。

  1. Enabled Promiscuous mode on ESX. Created new bridge (br1) and
    attached it to Host interface eth0.

使用管道工作在Docker中添加了新接口(eth1)使用此命令的IP地址的容器
pipework br1 $ CONTAINERID 0/0

Using pipework added a new interface (eth1) in Docker container with an IP address using this command pipework br1 $CONTAINERID 0/0

在尝试将DHCP IP分配给
容器的新接口(eth1)之后,使用命令 pipework eth1 $ CONTAINERID dhclient

After I tried assigning DHCP IP to the new interface (eth1) of the container, using the command pipework eth1 $CONTAINERID dhclient

但是出现以下错误:
RTNETLINK答案:文件存在

为解决此问题,我刷新了容器中的eth1设备并再次运行
命令。我观察到我的docker守护程序崩溃了。 Docker
版本:1.12.3(客户端和服务器)。

To resolve this I flushed the eth1 device in the container and ran the command again. I observe that my docker daemon crashed. Docker version: 1.12.3 (both client and server).

请让我知道我在这里不见了。我希望我的容器的接口从ESX上运行的DHCP服务器获取DHCP IP。

Please let me know what I am missing here. I want my container's interface/s to acquire the DHCP IPs from DHCP server running on ESX.

推荐答案

您将需要使用macvlan或ipvlan驱动程序创建一个docker网络。
然后,您将需要使用DHCP IPAM驱动程序(IPAM代表IP地址管理)。

You will need to create a docker network with the macvlan or ipvlan driver. Then you will need to use the DHCP IPAM driver (IPAM stands for IP Address Management).

以下是要点,其中包含有关如何操作的一些解释类似:
https://gist.github.com/nerdalert/3d2b891d41e0fa8d688c

Here is a gist with some explanations of how to do something similar: https://gist.github.com/nerdalert/3d2b891d41e0fa8d688c

这篇关于如何配置Docker容器以从ESX上运行的dhcp服务器获取DHCP IP / s的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆