Linux, FreeBSD, Juniper, Cisco / Network security articles and troubleshooting guides
https://forum.ivorde.com/

Iptables: List rules as commands
https://forum.ivorde.com/iptables-list-rules-as-commands-t19787.html
Page 1 of 1

Author:  mandrei99 [ Sun Mar 15, 2015 5:52 pm ]
Post subject:  Iptables: List rules as commands

To list Iptables rules as commands ready to be entered, use the -S iptables option:
Quote:
-S, --list-rules [chain]
Print all rules in the selected chain. If no chain is selected, all chains are printed like iptables-save. Like every other iptables command, it applies
to the specified table (filter is the default).

List iptables forward rules as commands


Code:
# iptables -S

List iptables NAT rules as commands


Code:
# iptables -S -t nat

Page 1 of 1 All times are UTC - 5 hours [ DST ]
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
http://www.phpbb.com/