Skip to Content
Linux Security Cookbook
book

Linux Security Cookbook

by Daniel J. Barrett, Richard E. Silverman, Robert G. Byrnes
June 2003
Intermediate to advanced
336 pages
8h 54m
English
O'Reilly Media, Inc.
Content preview from Linux Security Cookbook

3.1. Listing Your Network Interfaces

Problem

You want a list of your network interfaces.

Solution

To list all interfaces, whether up or down, whose drivers are loaded:

$ ifconfig -a

To list all interfaces that are up:

$ ifconfig

To list a single interface, commonly eth0:

$ ifconfig eth0

Discussion

If you are not root, ifconfig might not be in your path: try /sbin/ifconfig.

When invoked with the -a option, ifconfig lists all network interfaces that are up or down, but it will miss physical interfaces whose drivers are not loaded. For example, suppose you have a box with two Ethernet cards installed (eth0 and eth1) from different manufacturers, with different drivers, but only one (eth0) is configured in Linux (i.e., there is an /etc/sysconfig/network-scripts/ifcfg-* file for it). The other interface you don’t normally use. ifconfig -a will not show the second interface until you run ifconfig eth1 to load the driver.

See Also

ifconfig(8).

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Practical Linux Security Cookbook - Second Edition

Practical Linux Security Cookbook - Second Edition

Tajinder Kalsi
Mastering Linux Command Line

Mastering Linux Command Line

Coding Gears | Train Your Brain

Publisher Resources

ISBN: 0596003919Errata Page