Linux Networking - "ip X" instead of ifconfig/route/etc?
I'm used to using commands such as ifconfig
, route
and so forth on linux to check and change network information. However I know there is an ip
command (with various subcommands). I heard somewhere this is 'The right way' now. Any particular reason why I should ditch ifconfig/route/etc? What's your preference? Is there anything one set can do that the others can't?
i think you cannot access more advanced iproute2 features [ for instance multiple routing tables, routing based on src address or filter ] using ipconfig+route.
for me syntax of ip is much more logical and easier to use.
The command ip
belongs to the collection of utilities called iproute2.
Their manifesto:
Most network configuration manuals still refer to ifconfig and route as the primary network configuration tools, but ifconfig is known to behave inadequately in modern network environments. They should be deprecated, but most distros still include them. Most network configuration systems make use of ifconfig and thus provide a limited feature set. The /etc/net project aims to support most modern network technologies, as it doesn't use ifconfig and allows a system administrator to make use of all iproute2 features, including traffic control.
In short it combines a number of different legacy interfaces and provides access to newer features such as policy based routing. With the benefit of a more consistent command set.
iproute will eventually supersede ifconfig et al. currently there is little difference, but the syntax of ip is (at least for me) way more readable.
ifconfig and route are available on all Unixes under the sun (oh oh oh) since 1985 or so (and even on non-unixes, route exists under windows too). ip is overall better, but still uncommon except on recent linux distros. So what? know both ways and hope that everyone will switch to ip soon :)