Skip to Content
Linux Firewalls, Third Edition
book

Linux Firewalls, Third Edition

by Steve Suehring, Robert Ziegler
September 2005
Intermediate to advanced
552 pages
13h 30m
English
Sams
Content preview from Linux Firewalls, Third Edition

Listing the Firewall Rules

It's a good idea to list the rules you've defined, to double-check that they are installed and are in the order you expect. The -L command lists the actual rules for a given chain as they exist in the internal kernel table. Rules are listed in the order in which they are matched against a packet.

The basic format of the iptables list command is as follows:

iptables [-v -n] -L [chain]

or

iptables [-t <table>] [-v -n] -L [chain]

The first format refers to the default filter table. If a specific chain isn't specified, the command lists all rules on the three built-in filter table chains, plus any user-defined chains.

The second format is needed to list the rules on the nat or mangle tables.

Adding the -v option is ...

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

Linux Firewalls

Linux Firewalls

Michael Rash

Publisher Resources

ISBN: 0672327716Purchase book