Skip to content
This repository has been archived by the owner on Nov 1, 2021. It is now read-only.

Feature request: report all IP addresses associated with an interface, not just one #20

Closed
siebenmann opened this issue Jul 27, 2017 · 4 comments

Comments

@siebenmann
Copy link
Contributor

On machines with multiple IP address aliases associated with a single interface, it would be quite nice if trawl had an option to report all of them. At least on Linux there is no current convenient, compact way to report this information, and trawl is already reporting so much other useful stuff in one place. As far as I can tell trawl already obtains all of the IP addresses for each interface (cf issue #19), it just doesn't report them (or record them).

@robphoenix
Copy link
Owner

Yeah, this is a great idea.

@robphoenix
Copy link
Owner

Closed in 22dc776

@siebenmann If you find the time I'd love to hear if this works from your point of view. Currently each address will be printed on a separate line, but I may change this to a comma separated list. You'll have to go get or pull from source, I'll make a new release next week.

@siebenmann
Copy link
Contributor Author

Some notes:

  • trawl -4c or trawl -6c doesn't report an error, although it doesn't work without an interface name. I think it should report an error here rather than effectively ignore the argument.
  • It would be nice to have some marker in basic 'trawl' output that there are multiple IP addresses attached to an interface (ideally which type). Otherwise you have to know that you have multiple IPs somewhere and guess what interface they're probably on.
  • It would be nice to have an option where the standard 'trawl' output somehow included all IPv4 and IPv6 addresses attached to each interface. Failing that, at least an output mode that was 'give me all IP addresses for all interfaces listed in some way'.

My usage case is that I don't necessarily remember or care what a system's interface(s) are called, but I would like to get a list of all of its IP addresses, possibly with some information about which interfaces they're attached to. So I imagine perhaps output like this:

$ trawl -A -4
em0      128.100.3.51/24 128.100.3.58/24
em0.151  192.168.151.51/24
extun    128.100.3.51/32

(-A for 'all addresses', '-4' for 'restricted to IPv4 addresses'. If IPv6 addresses were included, they might be a separate line for each interface or added to the end of the line.)

For all-address mode and IPv6 addresses, you might want to default to excluding link-local fe80::/10 addresses, since otherwise all up interfaces will have an IPv6 address even if it's not particularly useful.

@robphoenix
Copy link
Owner

I think it should report an error here rather than effectively ignore the argument.

Agreed.

Your suggestions for listing all IP addresses are good, and I definitely think worthwhile to have included. I'm not sure yet what this will look like. I'm going to open new issues for each of these and start working on them. Thanks again @siebenmann!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants