Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/picatz/iface
🕶 Cross-platform network interface command-line utility.
https://github.com/picatz/iface
command-line cross-platform linux macos network windows
Last synced: 5 days ago
JSON representation
🕶 Cross-platform network interface command-line utility.
- Host: GitHub
- URL: https://github.com/picatz/iface
- Owner: picatz
- Created: 2017-12-28T20:57:39.000Z (almost 7 years ago)
- Default Branch: main
- Last Pushed: 2023-01-23T10:15:11.000Z (almost 2 years ago)
- Last Synced: 2024-05-02T06:10:32.124Z (7 months ago)
- Topics: command-line, cross-platform, linux, macos, network, windows
- Language: Go
- Homepage:
- Size: 19.5 KB
- Stars: 17
- Watchers: 1
- Forks: 4
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# iface
> Network interface command-line utility.Tools like `ifconfig`, `ip` and `ipconfig` are awesome! But, sometimes they're just a little too much to parse -- or you just don't want to fuss with all of that. With `iface`, you get a clean, scriptable command-line utility that's lightweight, cross-platform, and easy to learn. Learn once, use everywhere!
## Supported Platforms
> Thanks to [`VBaczynski`](https://github.com/VBaczynski) for helping test FreeBSD!
* macOS
* Linux
* Windows
* FreeBSD## Install
```
$ go get github.com/picatz/iface
```## Build from Source
Until I've figured out a better solution:
```
$ go get github.com/urfave/cli
$ git clone https://github.com/picatz/iface.git
$ cd iface
$ go build iface.go
```Build `iface.exe` on macOS or Linux to run on a Windows box:
```
$ GOOS=windows GOARCH=386 go build iface.go
```## Example Usage
Get the first `default` ( non-[loopback](https://en.wikipedia.org/wiki/Loopback#Virtual_network_interface) ) network [interface](https://en.wikipedia.org/wiki/Network_interface):
> This sort of simulates the LibPcap [`lookupdev`](https://linux.die.net/man/3/pcap_lookupdev) function to get the default interface to capture packets on.```
$ iface default
```Get all of the network interface names available on the system:
```
$ iface names
```Get network interface names with thier [mac addresses](https://en.wikipedia.org/wiki/MAC_address):
```
$ iface macs
```Get network interface names with their [IP addresses](https://en.wikipedia.org/wiki/IP_address):
```
$ iface ips
```## Command-line Interface
```
NAME:
iface - network interface command-line utilityUSAGE:
iface [global options] command [command options] [arguments...]VERSION:
1.0.1COMMANDS:
names all network interface names
macs network interfaces with their mac addresses
mtus network interfaces with their maximum transmission unit (mtu)s
ips network interfaces with their (local) ip addresses
default the first non-loopback network interface
help, h Shows a list of commands or help for one commandGLOBAL OPTIONS:
--help, -h show help
--version, -v print the version
```