In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-17 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/01 Report--
This article mainly introduces "the usage of Linux basic command iptables-save". In daily operation, I believe many people have doubts about the usage of Linux basic command iptables-save. The editor consulted all kinds of materials and sorted out simple and easy-to-use operation methods. I hope it will be helpful for you to answer the doubts about "the usage of Linux basic command iptables-save"! Next, please follow the editor to study!
Iptables-save
The iptables-save directive exports the current iptables configuration in the kernel to standard output. Output to a file is directed through the IO redirect feature.
The scope of this command: RedHat, RHEL, Ubuntu, CentOS, SUSE, openSUSE, Fedora.
1. Grammar
Iptables-save [options]
2. List of options
Option
Description
-c |-- counters
Output current packet counter and byte counter information
-t |-- table
Specify the table to export
-M |-- modprobemodprobe_program
Specifies the path to the modem probe. By default, iptables-Save checks "/ proc/sys/kernel/modprobe" to determine the path to the executable.
3. Examples
1) display iptables configuration
[root@localhost ~] # iptables-save-c / / display counter information
# Generated by iptables-save v1.4.7 on Sun Sep 30 16:20:14 2018
* filter
: INPUT ACCEPT [0:0]
: FORWARD ACCEPT [0:0]
: OUTPUT ACCEPT [1802:148673]
[14011 state RELATED,ESTABLISHED 18173274]-An INPUT-m state-- state RELATED,ESTABLISHED-j ACCEPT
[27ACCEPT 2268]-An INPUT-p icmp-j ACCEPT
[585 ACCEPT 30820]-An INPUT-I lo-j ACCEPT
[4526 eth+ 2073410]-An INPUT-I eth+-j ACCEPT
[0:0]-An INPUT-I wlan+-j ACCEPT
[0:0]-An INPUT-p tcp-m state-- state NEW-m tcp-- dport 22-j ACCEPT
[0:0]-An INPUT-p tcp-m state-- state NEW-m tcp-- dport 80-j ACCEPT
2) Export the information of the specified table
[root@localhost ~] # iptables-save-t nat / / output the information of the nat table
# Generated by iptables-save v1.4.7 on Sun Sep 30 16:21:17 2018
* nat
: PREROUTING ACCEPT [6181:2947647]
: POSTROUTING ACCEPT [573:30328]
: OUTPUT ACCEPT [2466:479800]
-A POSTROUTING-o eth+-j MASQUERADE
-A POSTROUTING-o wlan+-j MASQUERADE
COMMIT
# Completed on Sun Sep 30 16:21:17 2018
At this point, the study of "the usage of the Linux basic command iptables-save" is over. I hope to be able to solve your doubts. The collocation of theory and practice can better help you learn, go and try it! If you want to continue to learn more related knowledge, please continue to follow the website, the editor will continue to work hard to bring you more practical articles!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.