I finally added a firewall to debian and used iptables.

Source: Internet
Author: User
Finally, we added a firewall to debian and used iptables-the Linux Release Technology-Debian information. The following is a detailed description. Author: lpfrx

Write the following command in the firewall. sh file:

# Vim/etc/firewall. sh

Iptables-F
Iptables-N FIREWALL
Iptables-F FIREWALL
Iptables-a input-j FIREWALL
Iptables-a forward-j FIREWALL
Iptables-a firewall-p tcp-m tcp? Dport 110? Syn-j ACCEPT
Iptables-a firewall-p tcp-m tcp? Dport 80? Syn-j ACCEPT

# Webmin
Iptables-a firewall-p tcp-m tcp? Dport 10000? Syn-j ACCEPT

Iptables-a firewall-p tcp-m tcp? Dport 22? Syn-j ACCEPT
Iptables-a firewall-I lo-j ACCEPT
Iptables-a firewall-p udp-m udp? Sport 53-j ACCEPT

Iptables-a firewall-p tcp-m tcp? Syn-j REJECT
Iptables-a firewall-p udp-m udp-j REJECT

Then:
# Chmod 755/etc/firewall. sh

Continue, add firewall. sh to startup:
# Echo sh/etc/firewall. sh>/etc/init. d/rc. local

In this way, Debian adds a fire wall, which is easy to do. It is easy to use iptables to build a fire wall in Linux. Of course, it is simple. The complexity should be carefully studied.

Clear command: iptables-F
View command: iptables-L
Related Article

Contact Us

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

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.