Bring up but don't assign address with Netplan












1















I have an interface I want to bring up at boot but otherwise leave unconfigured. No DHCP, no static IP. Is there a way to do this with Netplan in 18.04?



I tried the following (where enp10s0f1 is the device in question) but it still just leaves the interface down:



# This file describes the network interfaces available on your system
# For more information, see netplan(5).
network:
version: 2
renderer: networkd
ethernets:
enp10s0f0:
dhcp4: yes
enp10s0f1:
dhcp4: no


The reason this matters is I have LXD containers using that interface via macvlan bridging, so the interface needs to be up, but it doesn't need (and I'd rather not have) an IP address on the host. I'd really prefer not to need to remember ip link set up enp10s0f1 when I reboot.



Update:



I found this bug report in Netplan's Launchpad that looks related, but as best as I can tell, it's for the opposite case: tell Netplan to configure an interface but don't automatically bring it up. However, it does sort of suggest that what I want to do isn't possible yet either. Is that the case? Is there any workaround besides abandoning Netplan?










share|improve this question
















bumped to the homepage by Community 10 hours ago


This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.




















    1















    I have an interface I want to bring up at boot but otherwise leave unconfigured. No DHCP, no static IP. Is there a way to do this with Netplan in 18.04?



    I tried the following (where enp10s0f1 is the device in question) but it still just leaves the interface down:



    # This file describes the network interfaces available on your system
    # For more information, see netplan(5).
    network:
    version: 2
    renderer: networkd
    ethernets:
    enp10s0f0:
    dhcp4: yes
    enp10s0f1:
    dhcp4: no


    The reason this matters is I have LXD containers using that interface via macvlan bridging, so the interface needs to be up, but it doesn't need (and I'd rather not have) an IP address on the host. I'd really prefer not to need to remember ip link set up enp10s0f1 when I reboot.



    Update:



    I found this bug report in Netplan's Launchpad that looks related, but as best as I can tell, it's for the opposite case: tell Netplan to configure an interface but don't automatically bring it up. However, it does sort of suggest that what I want to do isn't possible yet either. Is that the case? Is there any workaround besides abandoning Netplan?










    share|improve this question
















    bumped to the homepage by Community 10 hours ago


    This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.


















      1












      1








      1








      I have an interface I want to bring up at boot but otherwise leave unconfigured. No DHCP, no static IP. Is there a way to do this with Netplan in 18.04?



      I tried the following (where enp10s0f1 is the device in question) but it still just leaves the interface down:



      # This file describes the network interfaces available on your system
      # For more information, see netplan(5).
      network:
      version: 2
      renderer: networkd
      ethernets:
      enp10s0f0:
      dhcp4: yes
      enp10s0f1:
      dhcp4: no


      The reason this matters is I have LXD containers using that interface via macvlan bridging, so the interface needs to be up, but it doesn't need (and I'd rather not have) an IP address on the host. I'd really prefer not to need to remember ip link set up enp10s0f1 when I reboot.



      Update:



      I found this bug report in Netplan's Launchpad that looks related, but as best as I can tell, it's for the opposite case: tell Netplan to configure an interface but don't automatically bring it up. However, it does sort of suggest that what I want to do isn't possible yet either. Is that the case? Is there any workaround besides abandoning Netplan?










      share|improve this question
















      I have an interface I want to bring up at boot but otherwise leave unconfigured. No DHCP, no static IP. Is there a way to do this with Netplan in 18.04?



      I tried the following (where enp10s0f1 is the device in question) but it still just leaves the interface down:



      # This file describes the network interfaces available on your system
      # For more information, see netplan(5).
      network:
      version: 2
      renderer: networkd
      ethernets:
      enp10s0f0:
      dhcp4: yes
      enp10s0f1:
      dhcp4: no


      The reason this matters is I have LXD containers using that interface via macvlan bridging, so the interface needs to be up, but it doesn't need (and I'd rather not have) an IP address on the host. I'd really prefer not to need to remember ip link set up enp10s0f1 when I reboot.



      Update:



      I found this bug report in Netplan's Launchpad that looks related, but as best as I can tell, it's for the opposite case: tell Netplan to configure an interface but don't automatically bring it up. However, it does sort of suggest that what I want to do isn't possible yet either. Is that the case? Is there any workaround besides abandoning Netplan?







      networking netplan






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited May 17 '18 at 18:26







      Nick

















      asked May 17 '18 at 7:16









      NickNick

      10617




      10617





      bumped to the homepage by Community 10 hours ago


      This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.







      bumped to the homepage by Community 10 hours ago


      This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.
























          1 Answer
          1






          active

          oldest

          votes


















          0














          This is in fact a bug in Netplan: bug #1728134, bug #1763608. One of the netplan devs has acknowledged the latter, but it's not clear whether or not a fix will be provided.



          One workaround would be to manually create a systemd unit to bring the interface up. Create a file /etc/systemd/system/manual-iface.service with the following contents:



          [Unit]
          Description=Service to bring up/down unconfigured nic enp10s0f1
          After=network.target

          [Service]
          Type=oneshot
          RemainAfterExit=yes
          ExecStart=/sbin/ip link set enp10s0f1 up
          ExecStop=/sbin/ip link set enp10s0f1 down

          [Install]
          WantedBy=multi-user.target


          Then, enable it to run at boot:



          sudo systemctl enable manual-iface.service


          And you're good to go. You should see enp10s0f1 comes up automatically next time you boot.



          Alternatively, if you don't want to do that, reverting to ifupdown is still an option, as the question states. Fallback is described here. To summarize, install ifupdown, and then you can do the configuration using the traditional /etc/network/interfaces (which is well-documented across the web).






          share|improve this answer

























            Your Answer








            StackExchange.ready(function() {
            var channelOptions = {
            tags: "".split(" "),
            id: "89"
            };
            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',
            autoActivateHeartbeat: false,
            convertImagesToLinks: true,
            noModals: true,
            showLowRepImageUploadWarning: true,
            reputationToPostImages: 10,
            bindNavPrevention: true,
            postfix: "",
            imageUploader: {
            brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
            contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
            allowUrls: true
            },
            onDemand: true,
            discardSelector: ".discard-answer"
            ,immediatelyShowMarkdownHelp:true
            });


            }
            });














            draft saved

            draft discarded


















            StackExchange.ready(
            function () {
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f1037276%2fbring-up-but-dont-assign-address-with-netplan%23new-answer', 'question_page');
            }
            );

            Post as a guest















            Required, but never shown

























            1 Answer
            1






            active

            oldest

            votes








            1 Answer
            1






            active

            oldest

            votes









            active

            oldest

            votes






            active

            oldest

            votes









            0














            This is in fact a bug in Netplan: bug #1728134, bug #1763608. One of the netplan devs has acknowledged the latter, but it's not clear whether or not a fix will be provided.



            One workaround would be to manually create a systemd unit to bring the interface up. Create a file /etc/systemd/system/manual-iface.service with the following contents:



            [Unit]
            Description=Service to bring up/down unconfigured nic enp10s0f1
            After=network.target

            [Service]
            Type=oneshot
            RemainAfterExit=yes
            ExecStart=/sbin/ip link set enp10s0f1 up
            ExecStop=/sbin/ip link set enp10s0f1 down

            [Install]
            WantedBy=multi-user.target


            Then, enable it to run at boot:



            sudo systemctl enable manual-iface.service


            And you're good to go. You should see enp10s0f1 comes up automatically next time you boot.



            Alternatively, if you don't want to do that, reverting to ifupdown is still an option, as the question states. Fallback is described here. To summarize, install ifupdown, and then you can do the configuration using the traditional /etc/network/interfaces (which is well-documented across the web).






            share|improve this answer






























              0














              This is in fact a bug in Netplan: bug #1728134, bug #1763608. One of the netplan devs has acknowledged the latter, but it's not clear whether or not a fix will be provided.



              One workaround would be to manually create a systemd unit to bring the interface up. Create a file /etc/systemd/system/manual-iface.service with the following contents:



              [Unit]
              Description=Service to bring up/down unconfigured nic enp10s0f1
              After=network.target

              [Service]
              Type=oneshot
              RemainAfterExit=yes
              ExecStart=/sbin/ip link set enp10s0f1 up
              ExecStop=/sbin/ip link set enp10s0f1 down

              [Install]
              WantedBy=multi-user.target


              Then, enable it to run at boot:



              sudo systemctl enable manual-iface.service


              And you're good to go. You should see enp10s0f1 comes up automatically next time you boot.



              Alternatively, if you don't want to do that, reverting to ifupdown is still an option, as the question states. Fallback is described here. To summarize, install ifupdown, and then you can do the configuration using the traditional /etc/network/interfaces (which is well-documented across the web).






              share|improve this answer




























                0












                0








                0







                This is in fact a bug in Netplan: bug #1728134, bug #1763608. One of the netplan devs has acknowledged the latter, but it's not clear whether or not a fix will be provided.



                One workaround would be to manually create a systemd unit to bring the interface up. Create a file /etc/systemd/system/manual-iface.service with the following contents:



                [Unit]
                Description=Service to bring up/down unconfigured nic enp10s0f1
                After=network.target

                [Service]
                Type=oneshot
                RemainAfterExit=yes
                ExecStart=/sbin/ip link set enp10s0f1 up
                ExecStop=/sbin/ip link set enp10s0f1 down

                [Install]
                WantedBy=multi-user.target


                Then, enable it to run at boot:



                sudo systemctl enable manual-iface.service


                And you're good to go. You should see enp10s0f1 comes up automatically next time you boot.



                Alternatively, if you don't want to do that, reverting to ifupdown is still an option, as the question states. Fallback is described here. To summarize, install ifupdown, and then you can do the configuration using the traditional /etc/network/interfaces (which is well-documented across the web).






                share|improve this answer















                This is in fact a bug in Netplan: bug #1728134, bug #1763608. One of the netplan devs has acknowledged the latter, but it's not clear whether or not a fix will be provided.



                One workaround would be to manually create a systemd unit to bring the interface up. Create a file /etc/systemd/system/manual-iface.service with the following contents:



                [Unit]
                Description=Service to bring up/down unconfigured nic enp10s0f1
                After=network.target

                [Service]
                Type=oneshot
                RemainAfterExit=yes
                ExecStart=/sbin/ip link set enp10s0f1 up
                ExecStop=/sbin/ip link set enp10s0f1 down

                [Install]
                WantedBy=multi-user.target


                Then, enable it to run at boot:



                sudo systemctl enable manual-iface.service


                And you're good to go. You should see enp10s0f1 comes up automatically next time you boot.



                Alternatively, if you don't want to do that, reverting to ifupdown is still an option, as the question states. Fallback is described here. To summarize, install ifupdown, and then you can do the configuration using the traditional /etc/network/interfaces (which is well-documented across the web).







                share|improve this answer














                share|improve this answer



                share|improve this answer








                edited May 17 '18 at 23:00









                slangasek

                2,49811419




                2,49811419










                answered May 17 '18 at 20:23









                NickNick

                10617




                10617






























                    draft saved

                    draft discarded




















































                    Thanks for contributing an answer to Ask Ubuntu!


                    • Please be sure to answer the question. Provide details and share your research!

                    But avoid



                    • Asking for help, clarification, or responding to other answers.

                    • Making statements based on opinion; back them up with references or personal experience.


                    To learn more, see our tips on writing great answers.




                    draft saved


                    draft discarded














                    StackExchange.ready(
                    function () {
                    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f1037276%2fbring-up-but-dont-assign-address-with-netplan%23new-answer', 'question_page');
                    }
                    );

                    Post as a guest















                    Required, but never shown





















































                    Required, but never shown














                    Required, but never shown












                    Required, but never shown







                    Required, but never shown

































                    Required, but never shown














                    Required, but never shown












                    Required, but never shown







                    Required, but never shown







                    Popular posts from this blog

                    How did Captain America manage to do this?

                    迪纳利

                    南乌拉尔铁路局