In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-04-10 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)05/31 Report--
This article focuses on "how to achieve Linux secure iptables port forwarding". Interested friends may wish to take a look. The method introduced in this paper is simple, fast and practical. Let's let the editor take you to learn "how to achieve Linux secure iptables port forwarding".
1. The system turns on routing forwarding
Echo 1 > / proc/sys/net/ipv4/ip_forward
Sysctl-p
two。 Rule settin
# iptables-t nat-A PREROUTING-p tcp-- dport 2201-j DNAT-- to-destination 10.6.1.114
# iptables-t nat-A POSTROUTING-p tcp-s 10.6.1.114-sport 22-j SNAT-- to-source 42.162.6.44 tcp 2201
The four tables of iptables are:
Filter (filtering): packet filtering / blocking, which can include three built-in chain: INPUT, FORWARD, and OUTPUT.
Nat (address translation): IP address or port number translation, which can include three built-in chain,nat table, PREROUTING, OUTPUT, and POSTROUTING. The corresponding relationship of translation will be recorded when the session is established, and the return packets and subsequent messages of the same session will be automatically translated. This is because nat uses ip_conntrack module.
Mangle (package Management): used to modify IP messages, including PREROUTING, OUTPUT, INPUT, FORWARD, POSTROUTING 5 built-in chain.
Raw: this table takes precedence over ip_conntrack modules and other table, and is mainly used to exclude packets from session-state connections (such as tcp). Can include POSTROUTING, OUTPUT two built-in chain.
At this point, I believe you have a deeper understanding of "how to achieve Linux secure iptables port forwarding". 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.
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.