ifdata - Man Page
get network interface info without parsing ifconfig output
Examples (TL;DR)
- Display the whole configuration of the specified interface:
ifdata -p eth0
- Indicate the [e]xistence of the specified interface via the exit code:
ifdata -e eth0
- Display the IPv4 [a]dress and the [n]etmask of the specified interface:
ifdata -pa -pn eth0
- Display the [N]etwork adress, the [b]roadcast adress, and the MTU of the specified interface:
ifdata -pN -pb -pm eth0
- Display help:
ifdata
Synopsis
ifdata [options] {iface}
Description
ifdata can be used to check for the existence of a network interface, or to get information about the interface, such as its IP address. Unlike ifconfig or ip, ifdata has simple to parse output that is designed to be easily used by a shell script.
Options
- -h
Print out a help summary.
- -e
Test to see if the interface exists, exit nonzero if it does not.
- -p
Prints out the whole configuration of the interface.
- -pe
Prints "yes" or "no" if the interface exists or not.
- -pa
Prints the IPv4 address of the interface.
- -pn
Prints the netmask of the interface.
- -pN
Prints the network address of the interface.
- -pb
Prints the broadcast address of the interface.
- -pm
Prints the MTU of the interface.
Following options are Linux only.
- -ph
Prints the hardware address of the interface. Exit with a failure exit code if there is not hardware address for the given network interface.
- -pf
Prints the flags of the interface.
- -si
Prints out all the input statistics of the interface.
- -sip
Prints the number of input packets.
- -sib
Prints the number of input bytes.
- -sie
Prints the number of input errors.
- -sid
Prints the number of dropped input packets.
- -sif
Prints the number of input fifo overruns.
- -sic
Print the number of compressed input packets.
- -sim
Prints the number of input multicast packets.
- -so
Prints out all the output statistics of the interface.
- -sop
Prints the number of output packets.
- -sob
Prints the number of output bytes.
- -soe
Prints the number of output errors.
- -sod
Prints the number of dropped output packets.
- -sof
Prints the number of output fifo overruns.
- -sox
Print the number of output collisions.
- -soc
Prints the number of output carrier losses.
- -som
Prints the number of output multicast packets.
- -bips
Prints the number of bytes of incoming traffic measured in one second.
- -bops
Prints the number of bytes of outgoing traffic measured in one second.
Author
Benjamin BAYART