How can I expose macvlan containers in LAN? [Docker]

The name of the pictureThe name of the pictureThe name of the pictureClash 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.







share|improve this question
























    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.







    share|improve this question






















      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.







      share|improve this question












      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.









      share|improve this question











      share|improve this question




      share|improve this question










      asked Dec 6 '17 at 20:26









      jcardosovtl

      85




      85

























          active

          oldest

          votes











          Your Answer







          StackExchange.ready(function()
          var channelOptions =
          tags: "".split(" "),
          id: "106"
          ;
          initTagRenderer("".split(" "), "".split(" "), channelOptions);

          StackExchange.using("externalEditor", function()
          // Have to fire editor after snippets, if snippets enabled
          if (StackExchange.settings.snippets.snippetsEnabled)
          StackExchange.using("snippets", function()
          createEditor();
          );

          else
          createEditor();

          );

          function createEditor()
          StackExchange.prepareEditor(
          heartbeatType: 'answer',
          convertImagesToLinks: false,
          noModals: false,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: null,
          bindNavPrevention: true,
          postfix: "",
          onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          );



          );













           

          draft saved


          draft discarded


















          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



































          active

          oldest

          votes













          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes















           

          draft saved


          draft discarded















































           


          draft saved


          draft discarded














          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













































































          Popular posts from this blog

          How to check contact read email or not when send email to Individual?

          Bahrain

          Postfix configuration issue with fips on centos 7; mailgun relay