How can I expose macvlan containers in LAN? [Docker]
Clash Royale CLAN TAG#URR8PPP
up vote
0
down vote
favorite
My goal is to share with LAN my docker containers, under macvlan.
Macvlan creation:
sudo docker network create -d macvlan
--subnet=192.168.2.0/24
--gateway=192.168.2.1
-o macvlan_mode=bridge
-o parent=eth0 macvlan80
Note: My router is on 192.168.2.1
.
Run Containers:
sudo docker run --net=macvlan80 --ip=192.168.2.202 -P -d --name test_sshd1 eg_ssh
sudo docker run --net=macvlan80 --ip=192.168.2.203 -P -d --name test_sshd2 eg_ssh
Connect macvlan containers to host:
sudo ip link add mymacvlan92 link eth0 type macvlan mode bridge
sudo ip addr add 192.168.2.11/24 dev mymacvlan92
sudo ifconfig mymacvlan92 up
At this point I was expecting to ping
both containers, but this is the result.
ping 192.168.2.203
PING 192.168.2.203 (192.168.2.203) 56(84) bytes of data.
From 192.168.2.77 icmp_seq=1 Destination Host Unreachable
Not even in my machine or anyone in the LAN.
networking docker
add a comment |Â
up vote
0
down vote
favorite
My goal is to share with LAN my docker containers, under macvlan.
Macvlan creation:
sudo docker network create -d macvlan
--subnet=192.168.2.0/24
--gateway=192.168.2.1
-o macvlan_mode=bridge
-o parent=eth0 macvlan80
Note: My router is on 192.168.2.1
.
Run Containers:
sudo docker run --net=macvlan80 --ip=192.168.2.202 -P -d --name test_sshd1 eg_ssh
sudo docker run --net=macvlan80 --ip=192.168.2.203 -P -d --name test_sshd2 eg_ssh
Connect macvlan containers to host:
sudo ip link add mymacvlan92 link eth0 type macvlan mode bridge
sudo ip addr add 192.168.2.11/24 dev mymacvlan92
sudo ifconfig mymacvlan92 up
At this point I was expecting to ping
both containers, but this is the result.
ping 192.168.2.203
PING 192.168.2.203 (192.168.2.203) 56(84) bytes of data.
From 192.168.2.77 icmp_seq=1 Destination Host Unreachable
Not even in my machine or anyone in the LAN.
networking docker
add a comment |Â
up vote
0
down vote
favorite
up vote
0
down vote
favorite
My goal is to share with LAN my docker containers, under macvlan.
Macvlan creation:
sudo docker network create -d macvlan
--subnet=192.168.2.0/24
--gateway=192.168.2.1
-o macvlan_mode=bridge
-o parent=eth0 macvlan80
Note: My router is on 192.168.2.1
.
Run Containers:
sudo docker run --net=macvlan80 --ip=192.168.2.202 -P -d --name test_sshd1 eg_ssh
sudo docker run --net=macvlan80 --ip=192.168.2.203 -P -d --name test_sshd2 eg_ssh
Connect macvlan containers to host:
sudo ip link add mymacvlan92 link eth0 type macvlan mode bridge
sudo ip addr add 192.168.2.11/24 dev mymacvlan92
sudo ifconfig mymacvlan92 up
At this point I was expecting to ping
both containers, but this is the result.
ping 192.168.2.203
PING 192.168.2.203 (192.168.2.203) 56(84) bytes of data.
From 192.168.2.77 icmp_seq=1 Destination Host Unreachable
Not even in my machine or anyone in the LAN.
networking docker
My goal is to share with LAN my docker containers, under macvlan.
Macvlan creation:
sudo docker network create -d macvlan
--subnet=192.168.2.0/24
--gateway=192.168.2.1
-o macvlan_mode=bridge
-o parent=eth0 macvlan80
Note: My router is on 192.168.2.1
.
Run Containers:
sudo docker run --net=macvlan80 --ip=192.168.2.202 -P -d --name test_sshd1 eg_ssh
sudo docker run --net=macvlan80 --ip=192.168.2.203 -P -d --name test_sshd2 eg_ssh
Connect macvlan containers to host:
sudo ip link add mymacvlan92 link eth0 type macvlan mode bridge
sudo ip addr add 192.168.2.11/24 dev mymacvlan92
sudo ifconfig mymacvlan92 up
At this point I was expecting to ping
both containers, but this is the result.
ping 192.168.2.203
PING 192.168.2.203 (192.168.2.203) 56(84) bytes of data.
From 192.168.2.77 icmp_seq=1 Destination Host Unreachable
Not even in my machine or anyone in the LAN.
networking docker
asked Dec 6 '17 at 20:26
jcardosovtl
85
85
add a comment |Â
add a comment |Â
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f409307%2fhow-can-i-expose-macvlan-containers-in-lan-docker%23new-answer', 'question_page');
);
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password