• How to configure iptables to achieve local port forwarding


    sceneIf you are debugging a web program with resin, you need to restart resin frequently. This web program needs to be opened on port 80, and Linux limits ports below 1024 to have root permission. But you don’t want to always have a root terminal open when debugging programs. In this case, you can open […]

  • Detailed explanation of DNAT and SNAT settings in iptables under Linux


    DNAT (destination network address translation) is usually called destination mapping. SNAT (source network address translation) is usually called source mapping.These are two ways we often use when setting up Linux gateway or firewall. I didn’t explain them clearly before. Now I’ll explain them here.First of all, we need to understand the structure of IP packets, […]

  • How to configure iptables for routing function in Linux


    As a company’s Internet router, it needs to realize NAT address translation, DHCP, DNS cache, traffic control and application control. NAT address translation can be directly realized through iptables. DHCP service needs to install dhcpd, DNS cache function needs to use bind, traffic control can use TC, application control: for example, QQ blocking can be […]

  • Introduction to Linux basic commands 7: network transmission and security


    This chapter then introduces the network related commands 1、wgetFile download tool wget [option]… [URL]… wgetIt is a non interactive Downloader, supports HTTP, HTTPS and FTP protocols, and can also use a proxy. The so-called “non interactive” means that you can start awgetDownload the task and exit the system,wgetIt will exit after the download (or exception) […]

  • Firewalld of CentOS 8 has been unbound with iptables


    Article reprinted from: firewalld of CentOS 8 has been unbound with iptables Today, someone came to me and said that the one click installation script I used before is not working well. I hope I can help to see what happened. According to his description, it is preliminarily determined that the system is caused by […]

  • Linux Basic Firewall Setup and Open Port Command


    Close the firewall CentOS 7、RedHat 7Previous Linux distribution firewalls were opened and closed(iptables ): Effective immediately, restartInvalid Open and open service iptables start Close down service iptables stop restartTake effect Open and open chkconfig iptables on Close down chkconfig iptables off CentOS 7、RedHat 7Later Linux distribution firewalls were opened and closed(firewall ): systemctl stop firewalld.service […]

  • Detailed Interpretation of iptables under CentOS


    1: Preface Firewall, in fact, is used to realize the function of access control under Linux. It can be divided into hardware or software firewalls. No matter in which network, the firewall must work at the edge of the network. Our task is to define exactly how the firewall works. This is the strategy and […]

  • Explanation of iptables encapsulating IP commands under CentOS


    SeeLanding on that dayUnsuccessful IP A command to block all these IP: for i in `grep “$(date +”%b %d”)” /var/log/secure | grep “Failed password” | awk ‘{print $(NF-3)}’ | sort | uniq -c | sort -nr| awk ‘{print $2}’` ;do iptables -A INPUT -s $i -j DROP; done Effect: