Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Introduction to the basic configuration rules of iptables

2025-01-18 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/01 Report--

The main content of this article is "introduction to the basic configuration rules of iptables". Interested friends may wish to have a look. The method introduced in this paper is simple, fast and practical. Let's let the editor take you to learn "introduction to the basic configuration rules of iptables".

Iptables-t nat-A POSTROUTING-s 10.10.10.10 24-o eth0-j SNAT-to 220.202.19.86 NAT conversion

Iptables-t nat-A PREROUTING-d 220.202.19.84-p tcp-dport 80-j DNAT-to-d 10.10.0.25 Port Mapping

Iptables-An INPUT-s 0 limit 0-p icmp-m limit-limit 1 s-j ACCEPT allows one ICPM packet per second to pass

Iptables-A FORWARD-m mac-mac 00:08:74:98:09:A8-j ACCEPT allows MAC address 00:08:74:98:09:A8 to pass through

-dport specifies the target TCP/IP port such as-dport 80

-sport specifies the source TCP/IP port such as-sport 80

-p tcp specifies that the protocol is tcp such as-p tcp

-p icmp specifies that the protocol is ICMP

-p udp specifies that the protocol is UDP

-j DROP reject

-j ACCEPT allow

-j REJECT refuses and sends a message to the computer that sent the message

-j LOG registers grouped matching records in / var/log/messages

-m mac-mac bind MAC address

-m limit-limit 1lap s 1ag set time policy column

-s 10.10.0.0 or 10.10.0.0Ma16 specify the source address or address field

-d 10.10.0.0 or 10.10.0.0Ma16 specify the destination address or address field

-s! 10.10.0.0 other than the specified source address

Iptables-An adds a rule to the end of the chain

Iptables-D removes the rule from the specified chain

Iptables-F removes all rules from the specified chain

Iptables-I inserts a rule at the specified number position of the specified chain

Iptables-L lists all rules in the specified chain

Iptables-t nat-L lists all rules in all NAT chains

Iptables-N establishes a user-defined chain

Iptables-X delete user-defined chain

Default settings for iptables-P modification chains such as iptables-P INPUT DROP (set INPUT chains to DROP)

Service iptables save Save Settings

Chkconfig-list iptables to view runlevel

Chkconfig-level 235 iptables setting startup activation iptables level

Echo "1" >; / proc/sys/net/ipv4/ip_forward sets forwarding

At this point, I believe you have a deeper understanding of the "introduction to the basic configuration rules of iptables". You might as well do it in practice. Here is the website, more related content can enter the relevant channels to inquire, follow us, continue to learn!

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.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report