network restart fail on Ubuntu server 16.04
In Ubuntu 16.04 server I want to change IP from /etc/network/interfaces and run sudo service networking restart
and there is no error given but the IP didn't change.
I also ran sudo systemctl networking restart
and sudo ifdown eth0 && sudo ifup eth0
but the IP doesn't change.
How do I restart the network interface in Ubuntu 16.04 so it saves the changes?
networking server 16.04 systemd
|
show 1 more comment
In Ubuntu 16.04 server I want to change IP from /etc/network/interfaces and run sudo service networking restart
and there is no error given but the IP didn't change.
I also ran sudo systemctl networking restart
and sudo ifdown eth0 && sudo ifup eth0
but the IP doesn't change.
How do I restart the network interface in Ubuntu 16.04 so it saves the changes?
networking server 16.04 systemd
I think you're on a normal home-network. Those use usually the Dynamic Host Configuration Protocol (DHCP). If the DHCP-Server doesn't assign that IP to you, you won't get that IP (no matter what you configure on /etc/networking/interfaces). Worse, you could even get no net at all, if you misconfigured.
– Bobby
Jul 19 '16 at 8:56
@ManuToMatic I need to set static IP on interface!
– Sajad Bahmani
Jul 19 '16 at 8:58
Yes, and in the DHCP-Server too. If your server says "Yo, I'm configured to use192.0.0.42
so give it to me!" but your DHCP (Router/Modem) answers "Yeah, nice. But I only distribute192.168.0.2
to192.168.0.50
so you get that nice192.168.0.31
", then your server gets192.168.0.31
and not the IP he wants. If you want more information about how DHCP works: en.wikipedia.org/wiki/Dynamic_Host_Configuration_Protocol
– Bobby
Jul 19 '16 at 9:03
@ManuToMatic I don't have any DHCP server in my network and need set static IP
– Sajad Bahmani
Jul 19 '16 at 9:04
What? So how is your network configured? Believe me, if you didn't do anything special, your router IS a DHCP-Server. Alternatively you could explain exactly how your network is set up so we'd know more specific what we're on.
– Bobby
Jul 19 '16 at 9:06
|
show 1 more comment
In Ubuntu 16.04 server I want to change IP from /etc/network/interfaces and run sudo service networking restart
and there is no error given but the IP didn't change.
I also ran sudo systemctl networking restart
and sudo ifdown eth0 && sudo ifup eth0
but the IP doesn't change.
How do I restart the network interface in Ubuntu 16.04 so it saves the changes?
networking server 16.04 systemd
In Ubuntu 16.04 server I want to change IP from /etc/network/interfaces and run sudo service networking restart
and there is no error given but the IP didn't change.
I also ran sudo systemctl networking restart
and sudo ifdown eth0 && sudo ifup eth0
but the IP doesn't change.
How do I restart the network interface in Ubuntu 16.04 so it saves the changes?
networking server 16.04 systemd
networking server 16.04 systemd
edited Jul 19 '16 at 8:51
Sajad Bahmani
asked Jul 19 '16 at 8:39
Sajad BahmaniSajad Bahmani
812922
812922
I think you're on a normal home-network. Those use usually the Dynamic Host Configuration Protocol (DHCP). If the DHCP-Server doesn't assign that IP to you, you won't get that IP (no matter what you configure on /etc/networking/interfaces). Worse, you could even get no net at all, if you misconfigured.
– Bobby
Jul 19 '16 at 8:56
@ManuToMatic I need to set static IP on interface!
– Sajad Bahmani
Jul 19 '16 at 8:58
Yes, and in the DHCP-Server too. If your server says "Yo, I'm configured to use192.0.0.42
so give it to me!" but your DHCP (Router/Modem) answers "Yeah, nice. But I only distribute192.168.0.2
to192.168.0.50
so you get that nice192.168.0.31
", then your server gets192.168.0.31
and not the IP he wants. If you want more information about how DHCP works: en.wikipedia.org/wiki/Dynamic_Host_Configuration_Protocol
– Bobby
Jul 19 '16 at 9:03
@ManuToMatic I don't have any DHCP server in my network and need set static IP
– Sajad Bahmani
Jul 19 '16 at 9:04
What? So how is your network configured? Believe me, if you didn't do anything special, your router IS a DHCP-Server. Alternatively you could explain exactly how your network is set up so we'd know more specific what we're on.
– Bobby
Jul 19 '16 at 9:06
|
show 1 more comment
I think you're on a normal home-network. Those use usually the Dynamic Host Configuration Protocol (DHCP). If the DHCP-Server doesn't assign that IP to you, you won't get that IP (no matter what you configure on /etc/networking/interfaces). Worse, you could even get no net at all, if you misconfigured.
– Bobby
Jul 19 '16 at 8:56
@ManuToMatic I need to set static IP on interface!
– Sajad Bahmani
Jul 19 '16 at 8:58
Yes, and in the DHCP-Server too. If your server says "Yo, I'm configured to use192.0.0.42
so give it to me!" but your DHCP (Router/Modem) answers "Yeah, nice. But I only distribute192.168.0.2
to192.168.0.50
so you get that nice192.168.0.31
", then your server gets192.168.0.31
and not the IP he wants. If you want more information about how DHCP works: en.wikipedia.org/wiki/Dynamic_Host_Configuration_Protocol
– Bobby
Jul 19 '16 at 9:03
@ManuToMatic I don't have any DHCP server in my network and need set static IP
– Sajad Bahmani
Jul 19 '16 at 9:04
What? So how is your network configured? Believe me, if you didn't do anything special, your router IS a DHCP-Server. Alternatively you could explain exactly how your network is set up so we'd know more specific what we're on.
– Bobby
Jul 19 '16 at 9:06
I think you're on a normal home-network. Those use usually the Dynamic Host Configuration Protocol (DHCP). If the DHCP-Server doesn't assign that IP to you, you won't get that IP (no matter what you configure on /etc/networking/interfaces). Worse, you could even get no net at all, if you misconfigured.
– Bobby
Jul 19 '16 at 8:56
I think you're on a normal home-network. Those use usually the Dynamic Host Configuration Protocol (DHCP). If the DHCP-Server doesn't assign that IP to you, you won't get that IP (no matter what you configure on /etc/networking/interfaces). Worse, you could even get no net at all, if you misconfigured.
– Bobby
Jul 19 '16 at 8:56
@ManuToMatic I need to set static IP on interface!
– Sajad Bahmani
Jul 19 '16 at 8:58
@ManuToMatic I need to set static IP on interface!
– Sajad Bahmani
Jul 19 '16 at 8:58
Yes, and in the DHCP-Server too. If your server says "Yo, I'm configured to use
192.0.0.42
so give it to me!" but your DHCP (Router/Modem) answers "Yeah, nice. But I only distribute 192.168.0.2
to 192.168.0.50
so you get that nice 192.168.0.31
", then your server gets 192.168.0.31
and not the IP he wants. If you want more information about how DHCP works: en.wikipedia.org/wiki/Dynamic_Host_Configuration_Protocol– Bobby
Jul 19 '16 at 9:03
Yes, and in the DHCP-Server too. If your server says "Yo, I'm configured to use
192.0.0.42
so give it to me!" but your DHCP (Router/Modem) answers "Yeah, nice. But I only distribute 192.168.0.2
to 192.168.0.50
so you get that nice 192.168.0.31
", then your server gets 192.168.0.31
and not the IP he wants. If you want more information about how DHCP works: en.wikipedia.org/wiki/Dynamic_Host_Configuration_Protocol– Bobby
Jul 19 '16 at 9:03
@ManuToMatic I don't have any DHCP server in my network and need set static IP
– Sajad Bahmani
Jul 19 '16 at 9:04
@ManuToMatic I don't have any DHCP server in my network and need set static IP
– Sajad Bahmani
Jul 19 '16 at 9:04
What? So how is your network configured? Believe me, if you didn't do anything special, your router IS a DHCP-Server. Alternatively you could explain exactly how your network is set up so we'd know more specific what we're on.
– Bobby
Jul 19 '16 at 9:06
What? So how is your network configured? Believe me, if you didn't do anything special, your router IS a DHCP-Server. Alternatively you could explain exactly how your network is set up so we'd know more specific what we're on.
– Bobby
Jul 19 '16 at 9:06
|
show 1 more comment
2 Answers
2
active
oldest
votes
I think it is a bug in Ubuntu network scripts.
If you will modify network interface and then do the ifdown
it will fail. You must first bring the interface down. Then you can modify the file and then bring the interface up again:
$ ifdown eth0
$ $EDITOR /etc/network/interfaces
$ ifup eth0
add a comment |
You don't need to restart anything. Using Network Manager (i.e. click on the network icon), disconnect the interface, and then click on it to reconnect. You should see the new IP on the interface.
In general, it's good to remember that if Network Manager is running, it expects to be managing interfaces. Attempting to change interfaces with cli commands will usually result in network manager changing them back, or something similar/worse. If you don't want Network Manager to manage an interface, simply delete the interface from Network Manager.
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%2f800384%2fnetwork-restart-fail-on-ubuntu-server-16-04%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
2 Answers
2
active
oldest
votes
2 Answers
2
active
oldest
votes
active
oldest
votes
active
oldest
votes
I think it is a bug in Ubuntu network scripts.
If you will modify network interface and then do the ifdown
it will fail. You must first bring the interface down. Then you can modify the file and then bring the interface up again:
$ ifdown eth0
$ $EDITOR /etc/network/interfaces
$ ifup eth0
add a comment |
I think it is a bug in Ubuntu network scripts.
If you will modify network interface and then do the ifdown
it will fail. You must first bring the interface down. Then you can modify the file and then bring the interface up again:
$ ifdown eth0
$ $EDITOR /etc/network/interfaces
$ ifup eth0
add a comment |
I think it is a bug in Ubuntu network scripts.
If you will modify network interface and then do the ifdown
it will fail. You must first bring the interface down. Then you can modify the file and then bring the interface up again:
$ ifdown eth0
$ $EDITOR /etc/network/interfaces
$ ifup eth0
I think it is a bug in Ubuntu network scripts.
If you will modify network interface and then do the ifdown
it will fail. You must first bring the interface down. Then you can modify the file and then bring the interface up again:
$ ifdown eth0
$ $EDITOR /etc/network/interfaces
$ ifup eth0
answered Mar 20 '17 at 16:03
Hadrian WęgrzynowskiHadrian Węgrzynowski
1
1
add a comment |
add a comment |
You don't need to restart anything. Using Network Manager (i.e. click on the network icon), disconnect the interface, and then click on it to reconnect. You should see the new IP on the interface.
In general, it's good to remember that if Network Manager is running, it expects to be managing interfaces. Attempting to change interfaces with cli commands will usually result in network manager changing them back, or something similar/worse. If you don't want Network Manager to manage an interface, simply delete the interface from Network Manager.
add a comment |
You don't need to restart anything. Using Network Manager (i.e. click on the network icon), disconnect the interface, and then click on it to reconnect. You should see the new IP on the interface.
In general, it's good to remember that if Network Manager is running, it expects to be managing interfaces. Attempting to change interfaces with cli commands will usually result in network manager changing them back, or something similar/worse. If you don't want Network Manager to manage an interface, simply delete the interface from Network Manager.
add a comment |
You don't need to restart anything. Using Network Manager (i.e. click on the network icon), disconnect the interface, and then click on it to reconnect. You should see the new IP on the interface.
In general, it's good to remember that if Network Manager is running, it expects to be managing interfaces. Attempting to change interfaces with cli commands will usually result in network manager changing them back, or something similar/worse. If you don't want Network Manager to manage an interface, simply delete the interface from Network Manager.
You don't need to restart anything. Using Network Manager (i.e. click on the network icon), disconnect the interface, and then click on it to reconnect. You should see the new IP on the interface.
In general, it's good to remember that if Network Manager is running, it expects to be managing interfaces. Attempting to change interfaces with cli commands will usually result in network manager changing them back, or something similar/worse. If you don't want Network Manager to manage an interface, simply delete the interface from Network Manager.
answered May 30 '17 at 4:49
Hugh BuntuHugh Buntu
324211
324211
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.
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.
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%2f800384%2fnetwork-restart-fail-on-ubuntu-server-16-04%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
I think you're on a normal home-network. Those use usually the Dynamic Host Configuration Protocol (DHCP). If the DHCP-Server doesn't assign that IP to you, you won't get that IP (no matter what you configure on /etc/networking/interfaces). Worse, you could even get no net at all, if you misconfigured.
– Bobby
Jul 19 '16 at 8:56
@ManuToMatic I need to set static IP on interface!
– Sajad Bahmani
Jul 19 '16 at 8:58
Yes, and in the DHCP-Server too. If your server says "Yo, I'm configured to use
192.0.0.42
so give it to me!" but your DHCP (Router/Modem) answers "Yeah, nice. But I only distribute192.168.0.2
to192.168.0.50
so you get that nice192.168.0.31
", then your server gets192.168.0.31
and not the IP he wants. If you want more information about how DHCP works: en.wikipedia.org/wiki/Dynamic_Host_Configuration_Protocol– Bobby
Jul 19 '16 at 9:03
@ManuToMatic I don't have any DHCP server in my network and need set static IP
– Sajad Bahmani
Jul 19 '16 at 9:04
What? So how is your network configured? Believe me, if you didn't do anything special, your router IS a DHCP-Server. Alternatively you could explain exactly how your network is set up so we'd know more specific what we're on.
– Bobby
Jul 19 '16 at 9:06