Here’s a small Python script/module I put together to list all network
interfaces on the current server (tested on Linux only!) in a format
that easily lets me convert between name, index and address of an
interface.