What's the difference between ip link set eth0 down
and ip link set dev eth0 down
?
The difference between the commands does not appear to be documented anywhere.
What's the difference between ip link set eth0 down
and ip link set dev eth0 down
?
The difference between the commands does not appear to be documented anywhere.
There's no difference; dev
is optional provided the device name can't be mistaken for another keyword that the ip
command understands. For instance, if you had an interface named bridge
then you would have to use dev
as bridge
is also a keyword that ip
uses.
This is undocumented behavior, but it certainly appears to work.
You'll know if you ran afoul of ip
's option parser if you get a (slightly grammatically incorrect) message like:
either "dev" is duplicate, or "bridge" is a garbage.
For things that absolutely must be 100% working all the time, like network configuration scripts, you should include dev
just to be sure.