Ubuntu 18.04 Static IP with NetPlan require reboot












0














I need to provide OVA with static IP.



I'm using clean Ubuntu 18.04 image and running (testing) on virtual box and vmware.



When I configure the IP address in the yaml file, and running the command:



sudo netplan apply  


Nothing changes.



Only when I reboot the machine, the IP address changes.



This is what inside my yaml:



network:
version: 2
renderer:
ethernets:
enp0s3:
dhcp4: no
addresses: [10.0.2.100/24]
gateway4: 10.0.2.1
nameservers:
addresses: [8.8.8.8, 8.8.4.4]


Typically, Linux does not require rebooting.
Please help me.



@heynnema










share|improve this question
























  • @heynnema Can you help me?
    – Nimitack
    Dec 20 '18 at 10:34










  • FYI: change rederer: to renderer: networkd.
    – heynnema
    Dec 21 '18 at 15:46










  • FYI #2: use sudo netplan -debug generate before sudo netplan apply.
    – heynnema
    Dec 21 '18 at 15:47
















0














I need to provide OVA with static IP.



I'm using clean Ubuntu 18.04 image and running (testing) on virtual box and vmware.



When I configure the IP address in the yaml file, and running the command:



sudo netplan apply  


Nothing changes.



Only when I reboot the machine, the IP address changes.



This is what inside my yaml:



network:
version: 2
renderer:
ethernets:
enp0s3:
dhcp4: no
addresses: [10.0.2.100/24]
gateway4: 10.0.2.1
nameservers:
addresses: [8.8.8.8, 8.8.4.4]


Typically, Linux does not require rebooting.
Please help me.



@heynnema










share|improve this question
























  • @heynnema Can you help me?
    – Nimitack
    Dec 20 '18 at 10:34










  • FYI: change rederer: to renderer: networkd.
    – heynnema
    Dec 21 '18 at 15:46










  • FYI #2: use sudo netplan -debug generate before sudo netplan apply.
    – heynnema
    Dec 21 '18 at 15:47














0












0








0







I need to provide OVA with static IP.



I'm using clean Ubuntu 18.04 image and running (testing) on virtual box and vmware.



When I configure the IP address in the yaml file, and running the command:



sudo netplan apply  


Nothing changes.



Only when I reboot the machine, the IP address changes.



This is what inside my yaml:



network:
version: 2
renderer:
ethernets:
enp0s3:
dhcp4: no
addresses: [10.0.2.100/24]
gateway4: 10.0.2.1
nameservers:
addresses: [8.8.8.8, 8.8.4.4]


Typically, Linux does not require rebooting.
Please help me.



@heynnema










share|improve this question















I need to provide OVA with static IP.



I'm using clean Ubuntu 18.04 image and running (testing) on virtual box and vmware.



When I configure the IP address in the yaml file, and running the command:



sudo netplan apply  


Nothing changes.



Only when I reboot the machine, the IP address changes.



This is what inside my yaml:



network:
version: 2
renderer:
ethernets:
enp0s3:
dhcp4: no
addresses: [10.0.2.100/24]
gateway4: 10.0.2.1
nameservers:
addresses: [8.8.8.8, 8.8.4.4]


Typically, Linux does not require rebooting.
Please help me.



@heynnema







networking 18.04






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Dec 20 '18 at 10:40

























asked Dec 20 '18 at 10:33









Nimitack

1063




1063












  • @heynnema Can you help me?
    – Nimitack
    Dec 20 '18 at 10:34










  • FYI: change rederer: to renderer: networkd.
    – heynnema
    Dec 21 '18 at 15:46










  • FYI #2: use sudo netplan -debug generate before sudo netplan apply.
    – heynnema
    Dec 21 '18 at 15:47


















  • @heynnema Can you help me?
    – Nimitack
    Dec 20 '18 at 10:34










  • FYI: change rederer: to renderer: networkd.
    – heynnema
    Dec 21 '18 at 15:46










  • FYI #2: use sudo netplan -debug generate before sudo netplan apply.
    – heynnema
    Dec 21 '18 at 15:47
















@heynnema Can you help me?
– Nimitack
Dec 20 '18 at 10:34




@heynnema Can you help me?
– Nimitack
Dec 20 '18 at 10:34












FYI: change rederer: to renderer: networkd.
– heynnema
Dec 21 '18 at 15:46




FYI: change rederer: to renderer: networkd.
– heynnema
Dec 21 '18 at 15:46












FYI #2: use sudo netplan -debug generate before sudo netplan apply.
– heynnema
Dec 21 '18 at 15:47




FYI #2: use sudo netplan -debug generate before sudo netplan apply.
– heynnema
Dec 21 '18 at 15:47










1 Answer
1






active

oldest

votes


















0














See if the ip command will help...



Bring interfaces up or down



Previously users were used to using the ifconfig command. Users should now familiarize themselves with the more powerful ip command. Manually modifying network devices is now accomplished via the ip command.



As an example to bring up an interface and bring it back down:



ip link set enp0s3 up
ip link set enp0s3 down


See "man ip" for more information on how to manipulate the state of routing, network devices, interfaces and tunnels.



source: https://netplan.io/faq






share|improve this answer























  • The interface goes to down/up, but IP doesn’t change.
    – Nimitack
    Dec 23 '18 at 8:27










  • You might look at ip address { add | change | replace } IFADDR dev IFNAME, and other ip address commands.
    – heynnema
    Dec 23 '18 at 15:12











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%2f1103322%2fubuntu-18-04-static-ip-with-netplan-require-reboot%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














See if the ip command will help...



Bring interfaces up or down



Previously users were used to using the ifconfig command. Users should now familiarize themselves with the more powerful ip command. Manually modifying network devices is now accomplished via the ip command.



As an example to bring up an interface and bring it back down:



ip link set enp0s3 up
ip link set enp0s3 down


See "man ip" for more information on how to manipulate the state of routing, network devices, interfaces and tunnels.



source: https://netplan.io/faq






share|improve this answer























  • The interface goes to down/up, but IP doesn’t change.
    – Nimitack
    Dec 23 '18 at 8:27










  • You might look at ip address { add | change | replace } IFADDR dev IFNAME, and other ip address commands.
    – heynnema
    Dec 23 '18 at 15:12
















0














See if the ip command will help...



Bring interfaces up or down



Previously users were used to using the ifconfig command. Users should now familiarize themselves with the more powerful ip command. Manually modifying network devices is now accomplished via the ip command.



As an example to bring up an interface and bring it back down:



ip link set enp0s3 up
ip link set enp0s3 down


See "man ip" for more information on how to manipulate the state of routing, network devices, interfaces and tunnels.



source: https://netplan.io/faq






share|improve this answer























  • The interface goes to down/up, but IP doesn’t change.
    – Nimitack
    Dec 23 '18 at 8:27










  • You might look at ip address { add | change | replace } IFADDR dev IFNAME, and other ip address commands.
    – heynnema
    Dec 23 '18 at 15:12














0












0








0






See if the ip command will help...



Bring interfaces up or down



Previously users were used to using the ifconfig command. Users should now familiarize themselves with the more powerful ip command. Manually modifying network devices is now accomplished via the ip command.



As an example to bring up an interface and bring it back down:



ip link set enp0s3 up
ip link set enp0s3 down


See "man ip" for more information on how to manipulate the state of routing, network devices, interfaces and tunnels.



source: https://netplan.io/faq






share|improve this answer














See if the ip command will help...



Bring interfaces up or down



Previously users were used to using the ifconfig command. Users should now familiarize themselves with the more powerful ip command. Manually modifying network devices is now accomplished via the ip command.



As an example to bring up an interface and bring it back down:



ip link set enp0s3 up
ip link set enp0s3 down


See "man ip" for more information on how to manipulate the state of routing, network devices, interfaces and tunnels.



source: https://netplan.io/faq







share|improve this answer














share|improve this answer



share|improve this answer








edited Dec 22 '18 at 15:19

























answered Dec 20 '18 at 15:17









heynnema

18.1k22054




18.1k22054












  • The interface goes to down/up, but IP doesn’t change.
    – Nimitack
    Dec 23 '18 at 8:27










  • You might look at ip address { add | change | replace } IFADDR dev IFNAME, and other ip address commands.
    – heynnema
    Dec 23 '18 at 15:12


















  • The interface goes to down/up, but IP doesn’t change.
    – Nimitack
    Dec 23 '18 at 8:27










  • You might look at ip address { add | change | replace } IFADDR dev IFNAME, and other ip address commands.
    – heynnema
    Dec 23 '18 at 15:12
















The interface goes to down/up, but IP doesn’t change.
– Nimitack
Dec 23 '18 at 8:27




The interface goes to down/up, but IP doesn’t change.
– Nimitack
Dec 23 '18 at 8:27












You might look at ip address { add | change | replace } IFADDR dev IFNAME, and other ip address commands.
– heynnema
Dec 23 '18 at 15:12




You might look at ip address { add | change | replace } IFADDR dev IFNAME, and other ip address commands.
– heynnema
Dec 23 '18 at 15:12


















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.





Some of your past answers have not been well-received, and you're in danger of being blocked from answering.


Please pay close attention to the following guidance:


  • 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%2f1103322%2fubuntu-18-04-static-ip-with-netplan-require-reboot%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

flock() on closed filehandle LOCK_FILE at /usr/bin/apt-mirror

Mangá

Eduardo VII do Reino Unido