How to restore Ubuntu18.04 network kernel parameter?





.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty{ margin-bottom:0;
}







0















I messed up the kernel parameters and now no services except SSH could be started, does anybody know how to restore those network or kernel parameter? I don't want to re-install the system, Thanks in advance.










share|improve this question


















  • 1





    How can we know what method use used to disable or remove the kernel parameters. Did you disable it via a grub change, package removal, disable services or other. Look at your history would be what I would do first, then looking at logs (eg. apt) to see what (if anything) you removed; or if you have a clue on when, looking for files modified in that period etc. When you make a change, don't you leave breadcrumbs for yourself in case something doesn't work as expected? I'd check those notes.

    – guiverc
    Mar 28 at 3:25











  • i changed them via sysctl and sysctl.conf before, and then .bash_history was cleared afterwards. but then i found that some services were not able to be started. my question is is there any methods to restore these kernel parameters as they were right after the system was installed. i didn't change any configurations in grub and it's nothing to do with package removing ...

    – wrl
    Mar 28 at 6:36


















0















I messed up the kernel parameters and now no services except SSH could be started, does anybody know how to restore those network or kernel parameter? I don't want to re-install the system, Thanks in advance.










share|improve this question


















  • 1





    How can we know what method use used to disable or remove the kernel parameters. Did you disable it via a grub change, package removal, disable services or other. Look at your history would be what I would do first, then looking at logs (eg. apt) to see what (if anything) you removed; or if you have a clue on when, looking for files modified in that period etc. When you make a change, don't you leave breadcrumbs for yourself in case something doesn't work as expected? I'd check those notes.

    – guiverc
    Mar 28 at 3:25











  • i changed them via sysctl and sysctl.conf before, and then .bash_history was cleared afterwards. but then i found that some services were not able to be started. my question is is there any methods to restore these kernel parameters as they were right after the system was installed. i didn't change any configurations in grub and it's nothing to do with package removing ...

    – wrl
    Mar 28 at 6:36














0












0








0








I messed up the kernel parameters and now no services except SSH could be started, does anybody know how to restore those network or kernel parameter? I don't want to re-install the system, Thanks in advance.










share|improve this question














I messed up the kernel parameters and now no services except SSH could be started, does anybody know how to restore those network or kernel parameter? I don't want to re-install the system, Thanks in advance.







networking kernel






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked Mar 28 at 2:52









wrlwrl

32




32








  • 1





    How can we know what method use used to disable or remove the kernel parameters. Did you disable it via a grub change, package removal, disable services or other. Look at your history would be what I would do first, then looking at logs (eg. apt) to see what (if anything) you removed; or if you have a clue on when, looking for files modified in that period etc. When you make a change, don't you leave breadcrumbs for yourself in case something doesn't work as expected? I'd check those notes.

    – guiverc
    Mar 28 at 3:25











  • i changed them via sysctl and sysctl.conf before, and then .bash_history was cleared afterwards. but then i found that some services were not able to be started. my question is is there any methods to restore these kernel parameters as they were right after the system was installed. i didn't change any configurations in grub and it's nothing to do with package removing ...

    – wrl
    Mar 28 at 6:36














  • 1





    How can we know what method use used to disable or remove the kernel parameters. Did you disable it via a grub change, package removal, disable services or other. Look at your history would be what I would do first, then looking at logs (eg. apt) to see what (if anything) you removed; or if you have a clue on when, looking for files modified in that period etc. When you make a change, don't you leave breadcrumbs for yourself in case something doesn't work as expected? I'd check those notes.

    – guiverc
    Mar 28 at 3:25











  • i changed them via sysctl and sysctl.conf before, and then .bash_history was cleared afterwards. but then i found that some services were not able to be started. my question is is there any methods to restore these kernel parameters as they were right after the system was installed. i didn't change any configurations in grub and it's nothing to do with package removing ...

    – wrl
    Mar 28 at 6:36








1




1





How can we know what method use used to disable or remove the kernel parameters. Did you disable it via a grub change, package removal, disable services or other. Look at your history would be what I would do first, then looking at logs (eg. apt) to see what (if anything) you removed; or if you have a clue on when, looking for files modified in that period etc. When you make a change, don't you leave breadcrumbs for yourself in case something doesn't work as expected? I'd check those notes.

– guiverc
Mar 28 at 3:25





How can we know what method use used to disable or remove the kernel parameters. Did you disable it via a grub change, package removal, disable services or other. Look at your history would be what I would do first, then looking at logs (eg. apt) to see what (if anything) you removed; or if you have a clue on when, looking for files modified in that period etc. When you make a change, don't you leave breadcrumbs for yourself in case something doesn't work as expected? I'd check those notes.

– guiverc
Mar 28 at 3:25













i changed them via sysctl and sysctl.conf before, and then .bash_history was cleared afterwards. but then i found that some services were not able to be started. my question is is there any methods to restore these kernel parameters as they were right after the system was installed. i didn't change any configurations in grub and it's nothing to do with package removing ...

– wrl
Mar 28 at 6:36





i changed them via sysctl and sysctl.conf before, and then .bash_history was cleared afterwards. but then i found that some services were not able to be started. my question is is there any methods to restore these kernel parameters as they were right after the system was installed. i didn't change any configurations in grub and it's nothing to do with package removing ...

– wrl
Mar 28 at 6:36










2 Answers
2






active

oldest

votes


















1














Since you didn't specify which parameters you changed in sysctl.conf, it makes it somewhat difficult, but here's the basic method...




  • boot to the GRUB menu

  • choose Advanced Options

  • choose Recovery mode

  • choose Root access

  • at the # prompt, type:


    • sudo mount -o rw,remount /

    • sudo pico /etc/sysctl.conf

    • restore the values that you changed

    • if you need the default values, tell us which parameters you changed

    • save the file

    • reboot




Update #1:



Reinstalled Ubuntu. Sysctl.conf restored. System is fully operational.






share|improve this answer


























  • thanks! but i did forget what parameters i changed, and actually i used sysctl -w method to change some kernel parameters. now i just wonder would i get some new default kernel parameters if i upgrade the kernel ...

    – wrl
    Mar 29 at 3:04











  • @wrl no, you won't get a new sysctl.conf file with just a new kernel, but you probably will if you upgrade to 18.10. You might see if you can get a virgin sysctl.conf from the Ubuntu Live DVD/USB. Lesson learned... always backup sysctl.conf before making such massive and damaging changes...

    – heynnema
    Mar 29 at 13:02













  • @wrl status please...

    – heynnema
    Apr 3 at 2:56











  • unsolved, i'm checking all kernel parameters now, up to 900+...

    – wrl
    Apr 3 at 3:10











  • @wrl Why don't you just reinstall 18.04, or upgrade to 18.10?

    – heynnema
    Apr 3 at 13:22



















0














It seems to me that your best chance is to install a fresh copy of /etc/sysctl.conf



You should be able to dig that out somehow from the distribution.
When you have a copy of this file, then you need to copy it. THe easy way would be a USB stick, but maybe your system is too damaged to do that ? If so, you could make a bootable USB stick with the copy and mount the file systems of your damaged system and copy the file. I have in the past used the refind boot manager to do something like this. Once booted from the refind usb you need to do some chrooting and manual mounting to get to your system partitions. But it is doable. If you go down that path then I probably have written down the procedure somewhere for my own use if needed.



https://www.rodsbooks.com/refind/installing.html



If you dont want to use refind, there are other ways to make a bootable ubuntu usb - e.g.. :
https://tutorials.ubuntu.com/tutorial/tutorial-create-a-usb-stick-on-ubuntu#0






share|improve this answer


























  • actually i did this to recovery the sysctl.conf "apt-get -o Dpkg::Options::="--force-confmiss" -y install --reinstall procps", but then i realized that not all kernel parameters worte in the file. so something i changed by "sysctl -w" and "sysctl -p" cannot be reset by restoring the sysctl.conf. so now the question is how to fine tune all of the kernel parameters. what a terrible task ~

    – wrl
    Apr 1 at 1:03












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%2f1129289%2fhow-to-restore-ubuntu18-04-network-kernel-parameter%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









1














Since you didn't specify which parameters you changed in sysctl.conf, it makes it somewhat difficult, but here's the basic method...




  • boot to the GRUB menu

  • choose Advanced Options

  • choose Recovery mode

  • choose Root access

  • at the # prompt, type:


    • sudo mount -o rw,remount /

    • sudo pico /etc/sysctl.conf

    • restore the values that you changed

    • if you need the default values, tell us which parameters you changed

    • save the file

    • reboot




Update #1:



Reinstalled Ubuntu. Sysctl.conf restored. System is fully operational.






share|improve this answer


























  • thanks! but i did forget what parameters i changed, and actually i used sysctl -w method to change some kernel parameters. now i just wonder would i get some new default kernel parameters if i upgrade the kernel ...

    – wrl
    Mar 29 at 3:04











  • @wrl no, you won't get a new sysctl.conf file with just a new kernel, but you probably will if you upgrade to 18.10. You might see if you can get a virgin sysctl.conf from the Ubuntu Live DVD/USB. Lesson learned... always backup sysctl.conf before making such massive and damaging changes...

    – heynnema
    Mar 29 at 13:02













  • @wrl status please...

    – heynnema
    Apr 3 at 2:56











  • unsolved, i'm checking all kernel parameters now, up to 900+...

    – wrl
    Apr 3 at 3:10











  • @wrl Why don't you just reinstall 18.04, or upgrade to 18.10?

    – heynnema
    Apr 3 at 13:22
















1














Since you didn't specify which parameters you changed in sysctl.conf, it makes it somewhat difficult, but here's the basic method...




  • boot to the GRUB menu

  • choose Advanced Options

  • choose Recovery mode

  • choose Root access

  • at the # prompt, type:


    • sudo mount -o rw,remount /

    • sudo pico /etc/sysctl.conf

    • restore the values that you changed

    • if you need the default values, tell us which parameters you changed

    • save the file

    • reboot




Update #1:



Reinstalled Ubuntu. Sysctl.conf restored. System is fully operational.






share|improve this answer


























  • thanks! but i did forget what parameters i changed, and actually i used sysctl -w method to change some kernel parameters. now i just wonder would i get some new default kernel parameters if i upgrade the kernel ...

    – wrl
    Mar 29 at 3:04











  • @wrl no, you won't get a new sysctl.conf file with just a new kernel, but you probably will if you upgrade to 18.10. You might see if you can get a virgin sysctl.conf from the Ubuntu Live DVD/USB. Lesson learned... always backup sysctl.conf before making such massive and damaging changes...

    – heynnema
    Mar 29 at 13:02













  • @wrl status please...

    – heynnema
    Apr 3 at 2:56











  • unsolved, i'm checking all kernel parameters now, up to 900+...

    – wrl
    Apr 3 at 3:10











  • @wrl Why don't you just reinstall 18.04, or upgrade to 18.10?

    – heynnema
    Apr 3 at 13:22














1












1








1







Since you didn't specify which parameters you changed in sysctl.conf, it makes it somewhat difficult, but here's the basic method...




  • boot to the GRUB menu

  • choose Advanced Options

  • choose Recovery mode

  • choose Root access

  • at the # prompt, type:


    • sudo mount -o rw,remount /

    • sudo pico /etc/sysctl.conf

    • restore the values that you changed

    • if you need the default values, tell us which parameters you changed

    • save the file

    • reboot




Update #1:



Reinstalled Ubuntu. Sysctl.conf restored. System is fully operational.






share|improve this answer















Since you didn't specify which parameters you changed in sysctl.conf, it makes it somewhat difficult, but here's the basic method...




  • boot to the GRUB menu

  • choose Advanced Options

  • choose Recovery mode

  • choose Root access

  • at the # prompt, type:


    • sudo mount -o rw,remount /

    • sudo pico /etc/sysctl.conf

    • restore the values that you changed

    • if you need the default values, tell us which parameters you changed

    • save the file

    • reboot




Update #1:



Reinstalled Ubuntu. Sysctl.conf restored. System is fully operational.







share|improve this answer














share|improve this answer



share|improve this answer








edited Apr 8 at 7:26

























answered Mar 28 at 14:32









heynnemaheynnema

21.6k32361




21.6k32361













  • thanks! but i did forget what parameters i changed, and actually i used sysctl -w method to change some kernel parameters. now i just wonder would i get some new default kernel parameters if i upgrade the kernel ...

    – wrl
    Mar 29 at 3:04











  • @wrl no, you won't get a new sysctl.conf file with just a new kernel, but you probably will if you upgrade to 18.10. You might see if you can get a virgin sysctl.conf from the Ubuntu Live DVD/USB. Lesson learned... always backup sysctl.conf before making such massive and damaging changes...

    – heynnema
    Mar 29 at 13:02













  • @wrl status please...

    – heynnema
    Apr 3 at 2:56











  • unsolved, i'm checking all kernel parameters now, up to 900+...

    – wrl
    Apr 3 at 3:10











  • @wrl Why don't you just reinstall 18.04, or upgrade to 18.10?

    – heynnema
    Apr 3 at 13:22



















  • thanks! but i did forget what parameters i changed, and actually i used sysctl -w method to change some kernel parameters. now i just wonder would i get some new default kernel parameters if i upgrade the kernel ...

    – wrl
    Mar 29 at 3:04











  • @wrl no, you won't get a new sysctl.conf file with just a new kernel, but you probably will if you upgrade to 18.10. You might see if you can get a virgin sysctl.conf from the Ubuntu Live DVD/USB. Lesson learned... always backup sysctl.conf before making such massive and damaging changes...

    – heynnema
    Mar 29 at 13:02













  • @wrl status please...

    – heynnema
    Apr 3 at 2:56











  • unsolved, i'm checking all kernel parameters now, up to 900+...

    – wrl
    Apr 3 at 3:10











  • @wrl Why don't you just reinstall 18.04, or upgrade to 18.10?

    – heynnema
    Apr 3 at 13:22

















thanks! but i did forget what parameters i changed, and actually i used sysctl -w method to change some kernel parameters. now i just wonder would i get some new default kernel parameters if i upgrade the kernel ...

– wrl
Mar 29 at 3:04





thanks! but i did forget what parameters i changed, and actually i used sysctl -w method to change some kernel parameters. now i just wonder would i get some new default kernel parameters if i upgrade the kernel ...

– wrl
Mar 29 at 3:04













@wrl no, you won't get a new sysctl.conf file with just a new kernel, but you probably will if you upgrade to 18.10. You might see if you can get a virgin sysctl.conf from the Ubuntu Live DVD/USB. Lesson learned... always backup sysctl.conf before making such massive and damaging changes...

– heynnema
Mar 29 at 13:02







@wrl no, you won't get a new sysctl.conf file with just a new kernel, but you probably will if you upgrade to 18.10. You might see if you can get a virgin sysctl.conf from the Ubuntu Live DVD/USB. Lesson learned... always backup sysctl.conf before making such massive and damaging changes...

– heynnema
Mar 29 at 13:02















@wrl status please...

– heynnema
Apr 3 at 2:56





@wrl status please...

– heynnema
Apr 3 at 2:56













unsolved, i'm checking all kernel parameters now, up to 900+...

– wrl
Apr 3 at 3:10





unsolved, i'm checking all kernel parameters now, up to 900+...

– wrl
Apr 3 at 3:10













@wrl Why don't you just reinstall 18.04, or upgrade to 18.10?

– heynnema
Apr 3 at 13:22





@wrl Why don't you just reinstall 18.04, or upgrade to 18.10?

– heynnema
Apr 3 at 13:22













0














It seems to me that your best chance is to install a fresh copy of /etc/sysctl.conf



You should be able to dig that out somehow from the distribution.
When you have a copy of this file, then you need to copy it. THe easy way would be a USB stick, but maybe your system is too damaged to do that ? If so, you could make a bootable USB stick with the copy and mount the file systems of your damaged system and copy the file. I have in the past used the refind boot manager to do something like this. Once booted from the refind usb you need to do some chrooting and manual mounting to get to your system partitions. But it is doable. If you go down that path then I probably have written down the procedure somewhere for my own use if needed.



https://www.rodsbooks.com/refind/installing.html



If you dont want to use refind, there are other ways to make a bootable ubuntu usb - e.g.. :
https://tutorials.ubuntu.com/tutorial/tutorial-create-a-usb-stick-on-ubuntu#0






share|improve this answer


























  • actually i did this to recovery the sysctl.conf "apt-get -o Dpkg::Options::="--force-confmiss" -y install --reinstall procps", but then i realized that not all kernel parameters worte in the file. so something i changed by "sysctl -w" and "sysctl -p" cannot be reset by restoring the sysctl.conf. so now the question is how to fine tune all of the kernel parameters. what a terrible task ~

    – wrl
    Apr 1 at 1:03
















0














It seems to me that your best chance is to install a fresh copy of /etc/sysctl.conf



You should be able to dig that out somehow from the distribution.
When you have a copy of this file, then you need to copy it. THe easy way would be a USB stick, but maybe your system is too damaged to do that ? If so, you could make a bootable USB stick with the copy and mount the file systems of your damaged system and copy the file. I have in the past used the refind boot manager to do something like this. Once booted from the refind usb you need to do some chrooting and manual mounting to get to your system partitions. But it is doable. If you go down that path then I probably have written down the procedure somewhere for my own use if needed.



https://www.rodsbooks.com/refind/installing.html



If you dont want to use refind, there are other ways to make a bootable ubuntu usb - e.g.. :
https://tutorials.ubuntu.com/tutorial/tutorial-create-a-usb-stick-on-ubuntu#0






share|improve this answer


























  • actually i did this to recovery the sysctl.conf "apt-get -o Dpkg::Options::="--force-confmiss" -y install --reinstall procps", but then i realized that not all kernel parameters worte in the file. so something i changed by "sysctl -w" and "sysctl -p" cannot be reset by restoring the sysctl.conf. so now the question is how to fine tune all of the kernel parameters. what a terrible task ~

    – wrl
    Apr 1 at 1:03














0












0








0







It seems to me that your best chance is to install a fresh copy of /etc/sysctl.conf



You should be able to dig that out somehow from the distribution.
When you have a copy of this file, then you need to copy it. THe easy way would be a USB stick, but maybe your system is too damaged to do that ? If so, you could make a bootable USB stick with the copy and mount the file systems of your damaged system and copy the file. I have in the past used the refind boot manager to do something like this. Once booted from the refind usb you need to do some chrooting and manual mounting to get to your system partitions. But it is doable. If you go down that path then I probably have written down the procedure somewhere for my own use if needed.



https://www.rodsbooks.com/refind/installing.html



If you dont want to use refind, there are other ways to make a bootable ubuntu usb - e.g.. :
https://tutorials.ubuntu.com/tutorial/tutorial-create-a-usb-stick-on-ubuntu#0






share|improve this answer















It seems to me that your best chance is to install a fresh copy of /etc/sysctl.conf



You should be able to dig that out somehow from the distribution.
When you have a copy of this file, then you need to copy it. THe easy way would be a USB stick, but maybe your system is too damaged to do that ? If so, you could make a bootable USB stick with the copy and mount the file systems of your damaged system and copy the file. I have in the past used the refind boot manager to do something like this. Once booted from the refind usb you need to do some chrooting and manual mounting to get to your system partitions. But it is doable. If you go down that path then I probably have written down the procedure somewhere for my own use if needed.



https://www.rodsbooks.com/refind/installing.html



If you dont want to use refind, there are other ways to make a bootable ubuntu usb - e.g.. :
https://tutorials.ubuntu.com/tutorial/tutorial-create-a-usb-stick-on-ubuntu#0







share|improve this answer














share|improve this answer



share|improve this answer








edited Mar 29 at 10:57

























answered Mar 29 at 10:46









storestyggeulvstorestyggeulv

214




214













  • actually i did this to recovery the sysctl.conf "apt-get -o Dpkg::Options::="--force-confmiss" -y install --reinstall procps", but then i realized that not all kernel parameters worte in the file. so something i changed by "sysctl -w" and "sysctl -p" cannot be reset by restoring the sysctl.conf. so now the question is how to fine tune all of the kernel parameters. what a terrible task ~

    – wrl
    Apr 1 at 1:03



















  • actually i did this to recovery the sysctl.conf "apt-get -o Dpkg::Options::="--force-confmiss" -y install --reinstall procps", but then i realized that not all kernel parameters worte in the file. so something i changed by "sysctl -w" and "sysctl -p" cannot be reset by restoring the sysctl.conf. so now the question is how to fine tune all of the kernel parameters. what a terrible task ~

    – wrl
    Apr 1 at 1:03

















actually i did this to recovery the sysctl.conf "apt-get -o Dpkg::Options::="--force-confmiss" -y install --reinstall procps", but then i realized that not all kernel parameters worte in the file. so something i changed by "sysctl -w" and "sysctl -p" cannot be reset by restoring the sysctl.conf. so now the question is how to fine tune all of the kernel parameters. what a terrible task ~

– wrl
Apr 1 at 1:03





actually i did this to recovery the sysctl.conf "apt-get -o Dpkg::Options::="--force-confmiss" -y install --reinstall procps", but then i realized that not all kernel parameters worte in the file. so something i changed by "sysctl -w" and "sysctl -p" cannot be reset by restoring the sysctl.conf. so now the question is how to fine tune all of the kernel parameters. what a terrible task ~

– wrl
Apr 1 at 1:03


















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%2f1129289%2fhow-to-restore-ubuntu18-04-network-kernel-parameter%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

How did Captain America manage to do this?

迪纳利

南乌拉尔铁路局