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

⛵ A strong fishing net for dragging along the sea bottom to collect IP addresses and similar flotsam & jetsam

License

Notifications You must be signed in to change notification settings

robphoenix/trawl

Repository files navigation

trawl

A strong fishing net for dragging along the sea bottom to collect IP addresses and similar flotsam & jetsam.

Prints out network interface information to the console, much like ifconfig/ipconfig/ip/ifdata.

Go Report Card

trawl
eth1   10.62.10.6     255.255.255.252  10.62.10.4/30   1500  00:ff:28:31:d0:72  fe80::d824:2e8d:bf80:69c9/64  2
wifi0  192.168.1.242  255.255.255.0    192.168.1.0/24  1500  10:02:b5:e4:de:8c  fe80::ed51:1db6:b32:ad90/64   2

Flags

Show column names.

trawl -n
Name   IPv4 Address   IPv4 Mask        IPv4 Network    MTU   MAC Address        IPv6 Address                  Address Count
----   ------------   ---------        ------------    ---   -----------        ------------                  -------------
eth1   10.62.10.6     255.255.255.252  10.62.10.4/30   1500  00:ff:28:31:d0:72  fe80::d824:2e8d:bf80:69c9/64  2
wifi0  192.168.1.242  255.255.255.0    192.168.1.0/24  1500  10:02:b5:e4:de:8c  fe80::ed51:1db6:b32:ad90/64   2

Filter interface names using a case insensitive regular expression.

trawl -f wi
wifi0  192.168.1.242  255.255.255.0  192.168.1.0/24  1500  10:02:b5:e4:de:8c  fe80::ed51:1db6:b32:ad90/64  2trawl -n -f eth
Name  IPv4 Address  IPv4 Mask        IPv4 Network   MTU   MAC Address        IPv6 Address                  Address Count
----  ------------  ---------        ------------   ---   -----------        ------------                  -------------
eth1  10.62.10.6    255.255.255.252  10.62.10.4/30  1500  00:ff:28:31:d0:72  fe80::d824:2e8d:bf80:69c9/64  2

Get a list of available interfaces. Without any flags trawl only prints out interfaces which are up.

trawl -i
eth0, eth1, lo, wifi0, wifi1, eth2

The loopback interface is ignored by default, but you can include it if you like.

trawl -l
eth1   10.62.10.6     255.255.255.252  10.62.10.4/30   1500  00:ff:28:31:d0:72  fe80::d824:2e8d:bf80:69c9/64  2
lo     127.0.0.1      255.0.0.0        127.0.0.0/8     1500  -                  ::1/128                       2
wifi0  192.168.1.242  255.255.255.0    192.168.1.0/24  1500  10:02:b5:e4:de:8c  fe80::ed51:1db6:b32:ad90/64   2

Specify the particular interface you want to know about.

trawl wifi0
wifi0  192.168.1.242  255.255.255.0  192.168.1.0/24  1500  10:02:b5:e4:de:8c  fe80::ed51:1db6:b32:ad90/64  2

Show only the specific information you want, requires an interface name be provided.

# IPv4 Addresstrawl -a wifi0
192.168.1.242
# IPv4 Subnet Masktrawl -m wifi0
255.255.255.0
# IPv4 Networktrawl -s wifi0
192.168.1.0/24
# IPv4 MTUtrawl -u wifi0
1500
# MAC Addresstrawl -hw wifi0
10:02:b5:e4:de:8c
# IPv6 Address & Masktrawl -6a wifi0
fe80::ed51:1db6:b32:ad90/64

Print a complete list of addresses for an interface.

trawl -4c wifi0
192.168.0.100/24
10.90.0.18/16trawl -6c wifi0
fe80::defe:3c33:4335:e669/64
fe80::/10

You can also get your public IP address.

trawl -p
104.238.169.73

All the same functionality is available in Windows.

C:\Users\robphoenix>trawl -l -n
Name                         IPv4 Address   IPv4 Mask        IPv4 Network    MTU   MAC Address        IPv6 Address                  Address Count
----                         ------------   ---------        ------------    ---   -----------        ------------                  -------------
Ethernet                     10.62.10.6     255.255.255.252  10.62.10.4/30   1500  00:ff:28:31:d0:72  fe80::d824:2e8d:bf80:69c9/64  2
Wi-Fi                        192.168.1.242  255.255.255.0    192.168.1.0/24  1500  10:02:b5:e4:de:8c  fe80::ed51:1db6:b32:ad90/64   2
Loopback Pseudo-Interface 1  127.0.0.1      255.0.0.0        127.0.0.0/8     -1    -                  ::1/128                       2

Installation

If you don't have the Go programming language installed you can download the appropriate binary for your system from the releases page, rename it as trawl, and put it in your path (howto ubuntu/howto windows).

I have not tried all of the binaries, so if there's a problem with one let me know, thanks.

If you do have Go installed...

go get -u github.com/robphoenix/trawl

Acknowledgements

I totally used the awesome @jessfraz's battery as a starting point and continual touchstone for how to build this. Trawl is far from perfect, but I've learnt from it, which was more the point.

Boat graphic by Freepik from Flaticon is licensed under CC BY 3.0. Made with Logo Maker

About

⛵ A strong fishing net for dragging along the sea bottom to collect IP addresses and similar flotsam & jetsam

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages