Is there any way to shut off a network interface on a Linux box from the command line? By shut off, I mean to make the link power down as per a Cisco switch's "shutdown" command. ip
, and ifconfig
and even rmmod <driver>
when used to bring a port down do not disconnect link; the device on the other end still sees a connection even when one disables a port using those utilities/methods.
Technically, at a device level I'm sure it can be done because when I perform
ip link set em1 down
ip link set em1 up
...then during the "up" phase, the NIC does go off for about 3-4 seconds (as seen on a switch's port cabled to that NIC, and on the port's status LED).
What I'm looking for is a command line utility that will perform the task. I have CentOS 7.2 on a Dell R610 using the onboard Broadcom nics.
This works for my Intel I219-V (e1000e) card. No link light or anything, totally dead:
But when I do the same for a realtek (r8169) card, it still has a link light.
It may be something you cannot control on certain cards or perhaps there's something in the driver code that can be tweaked if you're into such things. That would be my next step if I were really determined.
unfortunately it doesn't exist a general way in linux.
In the networking world it is very common to toggle a port "Cisco: shut / no shut, Juniper disable/enable" to identify or trigger autonegotiation.
In Linux you have to rely on the individual driver for your network card.