Bring up but don't assign address with Netplan
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
add a comment |
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
add a comment |
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
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
networking netplan
edited May 17 '18 at 18:26
Nick
asked May 17 '18 at 7:16
NickNick
11117
11117
add a comment |
add a comment |
1 Answer
1
active
oldest
votes
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).
add a comment |
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%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
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).
add a comment |
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).
add a comment |
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).
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).
edited May 17 '18 at 23:00
slangasek
2,57711419
2,57711419
answered May 17 '18 at 20:23
NickNick
11117
11117
add a comment |
add a comment |
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%2f1037276%2fbring-up-but-dont-assign-address-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