Can I exclude a IP address from a MacVLAN network

0 votes
I am already using a given IP address. Can I exclude it from  MacVLAN Network? If Yes, How?
Jul 3, 2019 in Docker by Namik
• 1,230 points

edited Jul 3, 2019 by Namik 1,364 views

1 answer to this question.

0 votes

Yes, this is certainly possible.

If you need to exclude IP addresses from being used in the Macvlan network, such as when a given IP address is already in use, use --aux-addresses as shown in the code snippet below:

$ docker network create -d macvlan  \
  --subnet=192.168.32.0/24  \
  --ip-range=192.168.32.128/25 \
  --gateway=192.168.32.254  \
  --aux-address="my-router=192.168.32.129" \
  -o parent=eth0 macnet32

For a futher understanding of MacVLAN networks in docker, you could refer to:

https://docs.docker.com/network/macvlan/

answered Jul 3, 2019 by Sirajul
• 59,070 points

Related Questions In Docker

0 votes
1 answer

How to find a Docker container IP address from the command line?

Hi@akhtar, You can use the docker inspect command ...READ MORE

answered Sep 4, 2020 in Docker by MD
• 95,200 points
1,661 views
0 votes
1 answer

How to obtain the Docker container's IP address from the host?

This can be done by executing the ...READ MORE

answered Jul 16, 2018 in Docker by Sophie may
• 10,550 points
7,309 views
+5 votes
19 answers
0 votes
2 answers

How can I inspect the file system of a failed `docker build

Failed command is a build that has ...READ MORE

answered Aug 6, 2018 in Docker by Nilesh
• 7,020 points
1,148 views
+2 votes
1 answer
+2 votes
1 answer

Deploy Docker Containers from Docker Cloud

To solve this problem, I followed advice ...READ MORE

answered Sep 3, 2018 in AWS by Priyaj
• 58,120 points
1,193 views
+1 vote
2 answers

How do I copy a file from docker container to host?

Here is a way which you can ...READ MORE

answered Aug 27, 2018 in Docker by Damon Salvatore
• 5,980 points
25,133 views
0 votes
1 answer

Can I run docker-compose inside a container?

Compose can also be run inside a ...READ MORE

answered Jun 10, 2019 in Docker by Sirajul
• 59,070 points
2,927 views