Help - Search - Members - Calendar
Full Version: How Can I Physically Disable Eth0 Interface
Linuxhelp > Support > Hardware Support
yandry
I need to create a Bash script that periodically disables and enables the eth0 interface in order to have the link going up and down. Using "ifconfig eth0 down", the eth0 is disabled but the physical link is still UP.
How can I physically disable eth0 interface using a Bash command? Is that possible?

Andrea
hughesjr
Yes, it is possible....

Most Linux distro's have a network startup script in /etc/init.d

some have seperate scripts for each NIC ... others don't.

what is your distro?
hughesjr
Actually, maybe no ...

do you mean is it possible to make the card be powered off (ie no lights on the hub and the card) ... make the card turn off. If that is the question, then the answer is no ... that is a function of power to the card.

If you mean can you make the interface not recieve traffic and dissappear from the ifconfig output, the answer is yes.
yandry
I need to get the link down, therefore according to what you said, the answer is No.
I also checked the boot script for networking setup (thanks for the hint) and as you said it doesn't perform such operations (it just enables loopback and ip interfaces...).
Thank u very much.
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2017 Invision Power Services, Inc.