Where can I find the source code for /bin/ip?

I’ve been using the command /bin/ip:

ip addr add dev eth0

I would like to see the source code of how the ip command works. Is it available?

Asked By: Chadness3


The ip program is part of the iproute2 software package, and can be downloaded from www.kernel.org. N.b. Unlike the old ipconfig program, which uses ioctls to do its job, the iproute2 utilities use Netlink sockets to communicate with the kernel. It helps understanding how the ip program works if you are familiarised with Netlink sockets.

Answered By: Johan Myréen
Categories: Answers Tags:
Answers are sorted by their score. The answer accepted by the question owner as the best is marked with
at the top-right corner.