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?

closed as off-topic by muru, Stephen Rauch, countermode, Archemar, Romeo Ninov Aug 4 '17 at 11:29

  • This question does not appear to be about Unix or Linux within the scope defined in the help center.
If this question can be reworded to fit the rules in the help center, please edit the question.

  • 3
    Are you looking for sources matching the distribution you are using? If so, you should mention which distribution you are using. – kasperd Aug 3 '17 at 21:38
  • 4
    We can help you better if you provide the Version and Distribution you are using and asking about. – mdpc Aug 3 '17 at 22:11
  • The ip utility is part of the iproute2 suite. – countermode Aug 4 '17 at 6:55
  • 2
    I'm voting to close this question as off-topic because asking for the source (code) of well-known software is most likely not useful for other U&L users. – countermode Aug 4 '17 at 6:59
  • @countermode It may be "well-known" to experts, but not to me and the other 4 who voted up.. Shouldn't questions that may be obvious to some still be left open for us less-enlightened individuals? – Chadness3 Aug 7 '17 at 15:09

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.

Not the answer you're looking for? Browse other questions tagged or ask your own question.