Where can I find the source code for /bin/ip?
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?
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.