Score:0

Set MacVLAN in Portainer to get IP from DHCP server

ru flag

I have a Portainer VM with 3 interfaces attached (eth0-eth2). I would like the containers to request IP from the DHCP Server that is located on each interface at x.x.x.1.

Lets take as an example eth0:

The subnet of this interface is 172.16.0/27 and I would like my containers get in IP in the range of 172.16.0.17-30. Under Portainer networks, I added another network with the following settings:

  • Name: 172Config
  • Driver: macvlan Parent card: eth0 Subnet: 172.16.0/27
  • Gateway: 172.16.1
  • IP Range: 172.16.16/28 ( I would like half of the subnet hosts to be provided to containers

Then I added another network:

  • Name: 172Network
  • Driver: macvlan
  • Macvlan configuration: Selected creation and then 172Config
  • Enable manual container attachment : True

Then I attached 172Network to a new httpd container but it doesnt work. I get the correct IP on the containers but I cant ping or establish any kind of connection to them. Any Portainer guru can advice whats the right way to do this?

Score:0
ru flag

The above configuration was correct. I had to set Promiscuous mode and Forged transmits to 'Accept' under the ESXi vSwitch security options. Once I've done that everything started working as expected and my firewall was able to list the new DHCP Leases.

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.