iptables
CautionManage iptables firewall
iptables -L -n -v
Low-level packet filtering. On RHEL 8+ nftables is the backend and iptables runs as a compatibility layer; day-to-day, use firewall-cmd on RHEL or ufw on Ubuntu. -L -n shows rules; rules added directly vanish on reboot unless saved.
Examples
iptables -L -n -v --line-numbersList rules with line numbers
Syntax
iptables [-L] [-A chain rule] [-F]
Before you run it
Bad rules lock you out; -F flushes everything.
Related commands
- firewall-cmdManage firewalld (RHEL)
- ufwUncomplicated Firewall
- ssSockets and listening ports
The same reference, with no signal at all
Every command on this site, held on your device. The app adds 632 more: 1,510 commands and 120 fix flows, searchable with no connection. Free to install, no ads (some content is a one-time purchase).
Get it free on the App Store