Error in network definition: unknown key dhcp4-overrides












0















I am trying to set up Ubuntu 18.04 LTS, which appears to be using netplan to configure networking. In this case I need to override the DNS servers provided by DHCP and use manually assigned nameservers. So I modified the netplan configuration as follows:



# For more information, see netplan(5).
network:
version: 2
renderer: networkd
ethernets:
enp2s1:
dhcp4: yes
dhcp4-overrides:
use-dns: false
dhcp6: yes
dhcp6-overrides:
use-dns: false
nameservers:
addresses: ["fd35:2ff0:b0b9:d0c0::1:1", 192.168.255.17]


In another question, and on netplan.io, it was explained that netplan had options dhcp4-overrides and dhcp6-overrides which would permit this, but these don't appear to work. netplan generate or netplan apply gives the error:



Error in network definition //etc/netplan/01-netcfg.yaml line 6 column 6: unknown key dhcp4-overrides


How, then, can I be sure that my specified nameservers will be used, and the nameservers obtained from DHCP will never be used? I'm willing to toss netplan in the bin if necessary.










share|improve this question























  • @steeldriver That is the question I linked to above.

    – Michael Hampton
    4 hours ago
















0















I am trying to set up Ubuntu 18.04 LTS, which appears to be using netplan to configure networking. In this case I need to override the DNS servers provided by DHCP and use manually assigned nameservers. So I modified the netplan configuration as follows:



# For more information, see netplan(5).
network:
version: 2
renderer: networkd
ethernets:
enp2s1:
dhcp4: yes
dhcp4-overrides:
use-dns: false
dhcp6: yes
dhcp6-overrides:
use-dns: false
nameservers:
addresses: ["fd35:2ff0:b0b9:d0c0::1:1", 192.168.255.17]


In another question, and on netplan.io, it was explained that netplan had options dhcp4-overrides and dhcp6-overrides which would permit this, but these don't appear to work. netplan generate or netplan apply gives the error:



Error in network definition //etc/netplan/01-netcfg.yaml line 6 column 6: unknown key dhcp4-overrides


How, then, can I be sure that my specified nameservers will be used, and the nameservers obtained from DHCP will never be used? I'm willing to toss netplan in the bin if necessary.










share|improve this question























  • @steeldriver That is the question I linked to above.

    – Michael Hampton
    4 hours ago














0












0








0








I am trying to set up Ubuntu 18.04 LTS, which appears to be using netplan to configure networking. In this case I need to override the DNS servers provided by DHCP and use manually assigned nameservers. So I modified the netplan configuration as follows:



# For more information, see netplan(5).
network:
version: 2
renderer: networkd
ethernets:
enp2s1:
dhcp4: yes
dhcp4-overrides:
use-dns: false
dhcp6: yes
dhcp6-overrides:
use-dns: false
nameservers:
addresses: ["fd35:2ff0:b0b9:d0c0::1:1", 192.168.255.17]


In another question, and on netplan.io, it was explained that netplan had options dhcp4-overrides and dhcp6-overrides which would permit this, but these don't appear to work. netplan generate or netplan apply gives the error:



Error in network definition //etc/netplan/01-netcfg.yaml line 6 column 6: unknown key dhcp4-overrides


How, then, can I be sure that my specified nameservers will be used, and the nameservers obtained from DHCP will never be used? I'm willing to toss netplan in the bin if necessary.










share|improve this question














I am trying to set up Ubuntu 18.04 LTS, which appears to be using netplan to configure networking. In this case I need to override the DNS servers provided by DHCP and use manually assigned nameservers. So I modified the netplan configuration as follows:



# For more information, see netplan(5).
network:
version: 2
renderer: networkd
ethernets:
enp2s1:
dhcp4: yes
dhcp4-overrides:
use-dns: false
dhcp6: yes
dhcp6-overrides:
use-dns: false
nameservers:
addresses: ["fd35:2ff0:b0b9:d0c0::1:1", 192.168.255.17]


In another question, and on netplan.io, it was explained that netplan had options dhcp4-overrides and dhcp6-overrides which would permit this, but these don't appear to work. netplan generate or netplan apply gives the error:



Error in network definition //etc/netplan/01-netcfg.yaml line 6 column 6: unknown key dhcp4-overrides


How, then, can I be sure that my specified nameservers will be used, and the nameservers obtained from DHCP will never be used? I'm willing to toss netplan in the bin if necessary.







18.04 netplan






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked 4 hours ago









Michael HamptonMichael Hampton

1,040820




1,040820













  • @steeldriver That is the question I linked to above.

    – Michael Hampton
    4 hours ago



















  • @steeldriver That is the question I linked to above.

    – Michael Hampton
    4 hours ago

















@steeldriver That is the question I linked to above.

– Michael Hampton
4 hours ago





@steeldriver That is the question I linked to above.

– Michael Hampton
4 hours ago










1 Answer
1






active

oldest

votes


















0














I'm about halfway to throwing netplan in the bin, but I have a workaround that appears to work.



Seeing that it was rendering to networkd, and that systemd-resolved was handling DNS, I just created the relevant configuration directly.



I dropped the dhcp overrides bits from netplan, leaving me with only:



# For more information, see netplan(5).
network:
version: 2
renderer: networkd
ethernets:
enp2s1:
dhcp4: yes
dhcp6: yes


Then I created a file /etc/systemd/resolved.conf.d/dns.conf to specify the DNS servers I needed:



[Resolve]
DNS=fd35:2ff0:b0b9:d0c0::1:1 192.168.255.17





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%2f1120998%2ferror-in-network-definition-unknown-key-dhcp4-overrides%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














    I'm about halfway to throwing netplan in the bin, but I have a workaround that appears to work.



    Seeing that it was rendering to networkd, and that systemd-resolved was handling DNS, I just created the relevant configuration directly.



    I dropped the dhcp overrides bits from netplan, leaving me with only:



    # For more information, see netplan(5).
    network:
    version: 2
    renderer: networkd
    ethernets:
    enp2s1:
    dhcp4: yes
    dhcp6: yes


    Then I created a file /etc/systemd/resolved.conf.d/dns.conf to specify the DNS servers I needed:



    [Resolve]
    DNS=fd35:2ff0:b0b9:d0c0::1:1 192.168.255.17





    share|improve this answer




























      0














      I'm about halfway to throwing netplan in the bin, but I have a workaround that appears to work.



      Seeing that it was rendering to networkd, and that systemd-resolved was handling DNS, I just created the relevant configuration directly.



      I dropped the dhcp overrides bits from netplan, leaving me with only:



      # For more information, see netplan(5).
      network:
      version: 2
      renderer: networkd
      ethernets:
      enp2s1:
      dhcp4: yes
      dhcp6: yes


      Then I created a file /etc/systemd/resolved.conf.d/dns.conf to specify the DNS servers I needed:



      [Resolve]
      DNS=fd35:2ff0:b0b9:d0c0::1:1 192.168.255.17





      share|improve this answer


























        0












        0








        0







        I'm about halfway to throwing netplan in the bin, but I have a workaround that appears to work.



        Seeing that it was rendering to networkd, and that systemd-resolved was handling DNS, I just created the relevant configuration directly.



        I dropped the dhcp overrides bits from netplan, leaving me with only:



        # For more information, see netplan(5).
        network:
        version: 2
        renderer: networkd
        ethernets:
        enp2s1:
        dhcp4: yes
        dhcp6: yes


        Then I created a file /etc/systemd/resolved.conf.d/dns.conf to specify the DNS servers I needed:



        [Resolve]
        DNS=fd35:2ff0:b0b9:d0c0::1:1 192.168.255.17





        share|improve this answer













        I'm about halfway to throwing netplan in the bin, but I have a workaround that appears to work.



        Seeing that it was rendering to networkd, and that systemd-resolved was handling DNS, I just created the relevant configuration directly.



        I dropped the dhcp overrides bits from netplan, leaving me with only:



        # For more information, see netplan(5).
        network:
        version: 2
        renderer: networkd
        ethernets:
        enp2s1:
        dhcp4: yes
        dhcp6: yes


        Then I created a file /etc/systemd/resolved.conf.d/dns.conf to specify the DNS servers I needed:



        [Resolve]
        DNS=fd35:2ff0:b0b9:d0c0::1:1 192.168.255.17






        share|improve this answer












        share|improve this answer



        share|improve this answer










        answered 4 hours ago









        Michael HamptonMichael Hampton

        1,040820




        1,040820






























            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%2f1120998%2ferror-in-network-definition-unknown-key-dhcp4-overrides%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

            GameSpot

            日野市

            Tu-95轟炸機