Docker Community Forums

Share and learn in the Docker community.

Docker macvlan driver query - Amazon Web Service


(Mohanestack) #1

Hello,

I am testing the possibilities of using macvlan driver in aws platform.

All my instance are getting IP address from the subnet 172.30.80.0/20 & gateway 172.30.80.1

set up 2 EC2 instances in the same subnet(172.30.80.0/20) with below configuration.

EC2 Instance A
Docker version 18.06.1-ce, build e68fc7a
IP address: 172.30.90.19

Created a macvlan network.
docker network create -d macvlan --subnet 172.30.80.0/20 --gateway 172.30.80.1 -o parent=eth0 pub_net

Start a container with IP address from macvlan network.
docker run -d --network pub_net --ip 172.30.80.10 testperf/testapp

Could verify container started successfully with given mac vlan ip address.

[
{
“Name”: “pub_net”,
“Id”: “1f98a3d2a7a3f0432b22947aa3073489929ace1dee5c48a745f6a7c2c5d1ecb1”,
“Created”: “2018-09-03T10:16:14.642803689Z”,
“Scope”: “local”,
“Driver”: “macvlan”,
“EnableIPv6”: false,
“IPAM”: {
“Driver”: “default”,
“Options”: {},
“Config”: [
{
“Subnet”: “172.30.80.0/20”,
“Gateway”: “172.30.80.1”
}
]
},
“Internal”: false,
“Attachable”: false,
“Ingress”: false,
“ConfigFrom”: {
“Network”: “”
},
“ConfigOnly”: false,
“Containers”: {
“6e38bf7534d173b4c61cab6d0901b7d82eb68d2e15427b0a9ee14788875ed0c3”: {
“Name”: “focused_saha”,
“EndpointID”: “3d06b5db5e8deb76c8d929528d4458cf7ssdb9b5f7c2a7965889e92653dd23226”,
“MacAddress”: “02:42:ac:1f:50:0a”,
“IPv4Address”: “172.30.80.10/20”,
“IPv6Address”: “”
}
},
“Options”: {
“parent”: “eth0”
},
“Labels”: {}
}
]

EC2 Instance B
IP address: 172.30.87.19

Tried to ping the docker container(172.30.80.10) launched in EC2 instance A from EC2 Instance B, host unreachable error throws.

How to make the EC2 instance B ping the container IP(macvlan network) in EC2 Instance A?
Do AWS support macvlan network driver?

Thanks in advance.

Regards,
Mohan