bring down network interface and up again


Recommended Posts

What's the best way to restart the network interface from the command line?

 

I have an issue where every few days my unRIAD server loses it's LAN connection (probably related to the drivers for my 2x10GB BCM57810 NIC), if I unplug the network cable and plug it back in again all is well again for a few more days.

 

I figured I could create a simple workaround with a scheduled userscript to detect the lack of network access and bring the interface down then up again e.g.

 

if ping -c 1 192.168.1.1 &> /dev/null
then
  echo "succces - NOP"
else
  echo "fail - restart NIC"
  [nic restart command here]
fi

 

Edited by ThatDude
typo
Link to comment

I too would be interested in this. The requirement to have Docker and VMs shut down to even consider touching networks in the GUI is inane, and turns what should be 5 seconds into a 10+ minute reboot process.

 

Hypothetically, something like

ifconfig br0 down && ifconfig br0 up

should do. Maybe would need to use your eth0/etc itself depending on what's actually getting hung up.

But in my experience, that has done nothing for the problem I've had at hand despite all indications that it should work.

So your mileage may vary.

  • Like 2
Link to comment
7 hours ago, Blooest said:

I too would be interested in this. The requirement to have Docker and VMs shut down to even consider touching networks in the GUI is inane, and turns what should be 5 seconds into a 10+ minute reboot process.

 

Hypothetically, something like

ifconfig br0 down && ifconfig br0 up

should do. Maybe would need to use your eth0/etc itself depending on what's actually getting hung up.

But in my experience, that has done nothing for the problem I've had at hand despite all indications that it should work.

So your mileage may vary.

 

That's what I was hoping for. A gracefully way to stop all necessary processes for br0 and restart them as necessary.

 

I guess the nuclear option is to stop the array, this triggers a global shutdown of services, but I was hoping for a better option. Perhaps stopping all the dockers, pausing VMs and restarting the interface is enough. Maybe someone with more experience can jump in.

 

Link to comment
  • 1 year later...
On 5/21/2022 at 6:24 PM, Blooest said:

I too would be interested in this. The requirement to have Docker and VMs shut down to even consider touching networks in the GUI is inane, and turns what should be 5 seconds into a 10+ minute reboot process.

 

Hypothetically, something like

ifconfig br0 down && ifconfig br0 up

should do. Maybe would need to use your eth0/etc itself depending on what's actually getting hung up.

But in my experience, that has done nothing for the problem I've had at hand despite all indications that it should work.

So your mileage may vary.

 

Ever since updating to 6.12, for months now, I've had an issue every 5-50 days at random intervals where Unraid itself will lose all network access, but all the dockers are fine. This is the first solution that worked for me other than fully restarting the server, thank you.

Link to comment
  • 4 weeks later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.