21

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

ip addr add 10.10.10.0 dev eth0

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

9
  • 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, 2017 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, 2017 at 22:11
  • The ip utility is part of the iproute2 suite. Aug 4, 2017 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. Aug 4, 2017 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, 2017 at 15:09

1 Answer 1

30

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 .