How can I restart the network on 18.04 with netplan?
I'm trying to do some stuff with docker in 18.04 Bionic Beaver (sever version!) which requires disabling the DNS resolver
sudo systemctl disable systemd-resolved.service
sudo systemctl stop systemd-resolved.service
Since all of the usual network tools don't appear to be available, I was pointed in the direction of netplan, specifically cat /etc/netplan/*.yaml
which returned
# This file is generated from information provided by
# the datasource. Changes to it will not persist across an instance.
# To disable cloud-init's network configuration capabilities, write a file
# /etc/cloud/cloud.cfg.d/99-disable-network-config.cfg with the following:
# network: {config: disabled}
network:
ethernets:
enp0s3:
addresses:
dhcp4: true
version: 2
So, being the lemming that I am I created /etc/cloud/cloud.cfg.d/99-disable-network-config.cfg
and populated it with network: {config: disabled}
I wanted to restart the network, and the suggestion I kept finding was
sudo netplan apply
which returned:
sudo: unable to resolve host generic: Resource temporarily unavailable
where my hostname is generic. I assume this is because I stopped resolution? But I think I'm back to my original problem because I'm following this guide which says you need to add dns=default
to NetworkManager.config. I assume I must add something similar for BB, but I wouldn't know where to put it.
18.04
add a comment |
I'm trying to do some stuff with docker in 18.04 Bionic Beaver (sever version!) which requires disabling the DNS resolver
sudo systemctl disable systemd-resolved.service
sudo systemctl stop systemd-resolved.service
Since all of the usual network tools don't appear to be available, I was pointed in the direction of netplan, specifically cat /etc/netplan/*.yaml
which returned
# This file is generated from information provided by
# the datasource. Changes to it will not persist across an instance.
# To disable cloud-init's network configuration capabilities, write a file
# /etc/cloud/cloud.cfg.d/99-disable-network-config.cfg with the following:
# network: {config: disabled}
network:
ethernets:
enp0s3:
addresses:
dhcp4: true
version: 2
So, being the lemming that I am I created /etc/cloud/cloud.cfg.d/99-disable-network-config.cfg
and populated it with network: {config: disabled}
I wanted to restart the network, and the suggestion I kept finding was
sudo netplan apply
which returned:
sudo: unable to resolve host generic: Resource temporarily unavailable
where my hostname is generic. I assume this is because I stopped resolution? But I think I'm back to my original problem because I'm following this guide which says you need to add dns=default
to NetworkManager.config. I assume I must add something similar for BB, but I wouldn't know where to put it.
18.04
Do you also have dnsmasq running?
– heynnema
Jan 18 at 1:33
It's not installed
– WhiskerBiscuit
Jan 18 at 4:15
add a comment |
I'm trying to do some stuff with docker in 18.04 Bionic Beaver (sever version!) which requires disabling the DNS resolver
sudo systemctl disable systemd-resolved.service
sudo systemctl stop systemd-resolved.service
Since all of the usual network tools don't appear to be available, I was pointed in the direction of netplan, specifically cat /etc/netplan/*.yaml
which returned
# This file is generated from information provided by
# the datasource. Changes to it will not persist across an instance.
# To disable cloud-init's network configuration capabilities, write a file
# /etc/cloud/cloud.cfg.d/99-disable-network-config.cfg with the following:
# network: {config: disabled}
network:
ethernets:
enp0s3:
addresses:
dhcp4: true
version: 2
So, being the lemming that I am I created /etc/cloud/cloud.cfg.d/99-disable-network-config.cfg
and populated it with network: {config: disabled}
I wanted to restart the network, and the suggestion I kept finding was
sudo netplan apply
which returned:
sudo: unable to resolve host generic: Resource temporarily unavailable
where my hostname is generic. I assume this is because I stopped resolution? But I think I'm back to my original problem because I'm following this guide which says you need to add dns=default
to NetworkManager.config. I assume I must add something similar for BB, but I wouldn't know where to put it.
18.04
I'm trying to do some stuff with docker in 18.04 Bionic Beaver (sever version!) which requires disabling the DNS resolver
sudo systemctl disable systemd-resolved.service
sudo systemctl stop systemd-resolved.service
Since all of the usual network tools don't appear to be available, I was pointed in the direction of netplan, specifically cat /etc/netplan/*.yaml
which returned
# This file is generated from information provided by
# the datasource. Changes to it will not persist across an instance.
# To disable cloud-init's network configuration capabilities, write a file
# /etc/cloud/cloud.cfg.d/99-disable-network-config.cfg with the following:
# network: {config: disabled}
network:
ethernets:
enp0s3:
addresses:
dhcp4: true
version: 2
So, being the lemming that I am I created /etc/cloud/cloud.cfg.d/99-disable-network-config.cfg
and populated it with network: {config: disabled}
I wanted to restart the network, and the suggestion I kept finding was
sudo netplan apply
which returned:
sudo: unable to resolve host generic: Resource temporarily unavailable
where my hostname is generic. I assume this is because I stopped resolution? But I think I'm back to my original problem because I'm following this guide which says you need to add dns=default
to NetworkManager.config. I assume I must add something similar for BB, but I wouldn't know where to put it.
18.04
18.04
edited Jan 18 at 0:29
WhiskerBiscuit
asked Jan 17 at 23:59
WhiskerBiscuitWhiskerBiscuit
1335
1335
Do you also have dnsmasq running?
– heynnema
Jan 18 at 1:33
It's not installed
– WhiskerBiscuit
Jan 18 at 4:15
add a comment |
Do you also have dnsmasq running?
– heynnema
Jan 18 at 1:33
It's not installed
– WhiskerBiscuit
Jan 18 at 4:15
Do you also have dnsmasq running?
– heynnema
Jan 18 at 1:33
Do you also have dnsmasq running?
– heynnema
Jan 18 at 1:33
It's not installed
– WhiskerBiscuit
Jan 18 at 4:15
It's not installed
– WhiskerBiscuit
Jan 18 at 4:15
add a comment |
0
active
oldest
votes
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
});
}
});
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
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f1110698%2fhow-can-i-restart-the-network-on-18-04-with-netplan%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
0
active
oldest
votes
0
active
oldest
votes
active
oldest
votes
active
oldest
votes
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.
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
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f1110698%2fhow-can-i-restart-the-network-on-18-04-with-netplan%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
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
Required, but never shown
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
Required, but never shown
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
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
Do you also have dnsmasq running?
– heynnema
Jan 18 at 1:33
It's not installed
– WhiskerBiscuit
Jan 18 at 4:15