I’m trying to build a development environment on MacOS with LXD.
The setup:
hyperkit (successor of xhyve port, not exactly, but still) with ubuntu 16.04 as guest VM.
For LXD ubuntu is a host.
From MacOS there is a bridged nic 192.168.64.0/24. Ubuntu gets an IP address.
LXD (3.0.3-0ubuntu1~16.04.1) + ZFS + LXD bridge network.
What I want is to get access from MacOS host inside containers, without needing to login into Ubuntu.
I’m trying to do this
eth0:
name: eth0
nictype: bridged
parent: lxdbr0
type: nic
eth1:
name: eth1
nictype: bridged
parent: br0
type: nic
eth0 gets an IP from lxdbr0, but eth1 can’t get an IP.
The question is – how can I assign an 2 IP addresses to a container. 1 from bridged network from ubuntu host, that is bridged with MacOS and the second from internal network.
The next step is to use avahi daemon to ssh into containers by names.
I’ve read about user and groups mapping, but do not understand clearly whether I need that or not…
Thanks.
With the bridged interface br1 the container sends a DHCP request to that interface for a DHCP lease. LXD is NOT involved in any way here.
It is up to the DHCP server on that bridge to respond to the request and for the container to receive and act on it.
You are describing how to get a container to receive a public IP address (well, from same source as host).
With VMware and virtual box, the first step is to set the setting “promiscuous” to the VM network interface. It is likely your virtualization software stumbles on that. Does it have such a setting?
In any case you can debug this using tshark/tcpdump.
Thanks for the reply.
I’ve read several articles about VMware and VirtualBox, but trying to achieve the same with Hyperkit. I’ve added promiscuous mode to bridged network in hyperkit vm. But is seems that lxd container sends a dhcp request, but not getting an IP. Maybe you know some workarounds, how to achieve this?
On Virtualbox, apart from setting the network interface setting to promiscuous (in the VB settings), you also need to set the host network interface to promiscuous mode as well (with ifconfig, etc). Sounds weird but it is a workaround. Give it a try because your capture resembles the same case with Virtualbox (when you ommit to ifconfig to promisc.)
ok, I couldn’t achieve the same behaviour with hyperkit. Made a setup with VB in promiscuous mode + host network.
But with this setup there are 2 problems. 1st, it takes some time to lease IP address after new container started. And sometimes traffic is not routed correctly, container restart helps with that.
I’ll try later to made it work with hyperkit. Thanks for help.