Full reset of network interface

12,041

You have not stated the operating system used. Depending on the operating system, you should run the disable and enable commands for the network card.

Example:

ifconfig eth0 down
ifconfig eth0 up

Example 2:

ifdown etho
ifup eth0

That will reinitialize network without the need of a reboot.

Share:
12,041

Related videos on Youtube

Paolo
Author by

Paolo

Terrible hobby programmer, trying to learn something.

Updated on September 18, 2022

Comments

  • Paolo
    Paolo almost 2 years

    I have a Raspberry Pi. If it's connected to a network, and cables are changed, IP numbers changed, and what not, it sometimes stops working. A simple reboot solves the problem.

    Is there any way of doing a full reset of everything that has to do with networking, without rebooting the whole operating system? How do I do that?

    • DavidPostill
      DavidPostill over 9 years
    • Giacomo1968
      Giacomo1968 over 9 years
      Should be moved to the Raspberry Pi specific site: raspberrypi.stackexchange.com
  • Paolo
    Paolo over 9 years
    Thank you for your answer. Does this fully equate to a reboot netwrokwise? I mean, is there anything else related to this being done at a boot compared to ifconfig down and up?
  • Overmind
    Overmind over 9 years
    It is a full 'reboot' wince the network interface is actually shut down and reinitialized. Other applications that use the network may still run independently of the network state, but the important thing is that the network subsystem reloads.
  • Paolo
    Paolo over 9 years
    Overmind, it didn't work. Makes no difference. I've tried to restart init.d/networking, but I don't get it up and running again after that.
  • Overmind
    Overmind over 9 years
    Do you get any errors on no error messages/nothing happens ?