# Iptables-save/etc/iptables. test. rules # gedit/etc/iptables. test. rules if you create a firewall rule based on the previous example, iptables-save will generate a file similar to the following: # Generatedbyiptables-savev1.3.1onSunApr2306 :# Iptables-Save>/etc/ Iptables. Test. rules
# Gedit/etc/iptables. test. rules
If you create a firewall rule based on the preceding example, iptables-save will generate a file similar to the following:
# Generated by iptables-save v1.3.1 on Sun Apr 23
* Filter
: Input accept [368: 102354]
: Forward accept [0: 0]
: Output accept [92952: 20764374]
-A input-m state -- state RELATED, ESTABLISHED-j ACCEPT
-A input-I eth0-p tcp-m tcp -- dport 22-j ACCEPT
-A input-I eth0-p tcp-m tcp -- dport 80-j ACCEPT
-A input-I lo-j ACCEPT
-A input-m limit -- limit 5/min-j LOG -- log-prefix "iptablesdenied:" -- log-level 7
-A input-j DROP
COMMIT
# Completed on Sun Apr 23 06:19:53 2006
The file content is actually a variety of iptables commands, but the command name iptables is omitted. You can edit the file and save it as needed. Run the following command to test the modified rule:
# Iptables-restore </etc/iptables. test. rules
If you have not added the iptables-save command to the/etc/network/interfaces file before, do not forget to save your modifications after the test.
# Iptables-save>/etc/iptables. up. rules
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.
A Free Trial That Lets You Build Big!
Start building with 50+ products and up to 12 months usage for Elastic Compute Service