Friday, January 14, 2011

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.

    From pQd
  • 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.

  • 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.

    Cian : And the disadvantage of a command set that most people don't already know. Unless you need features only in iproute, or are likely to, you're as well staying with route/ifconfig.
    Dan Carley : True. Quite whether `net-tools` will ever be truly deprecated seems open for interpretation. I would say go with whatever your distro favours though. That way you won't be shocked if `net-tools` does disappear and you can avoid instances such as `ifconfig` ignoring interface addresses that were administered with `ip addr`.
    David : ifconfig and route (and netstat) are not going to ever go away as long as UNIX as a whole continues to use them: variants from Solaris to HP-UX to AIX and beyond are still using these tools, and they are available on non-UNIX systems such as Windows. The ip utility - though quite nice - is only available on Linux.
    From Dan Carley
  • 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 :)

    From wazoox
  • I too have been advised to move from route/ifconfig over to ip, but just have never got round to it! Has anyone seen a side-by-side comparison of the two to make the switch a little less painless. (Not that using route was painfree!).

    From Coops

0 comments:

Post a Comment