Debian system firewall iptables settings

Source: Internet
Author: User
Write the following command in firewall. sh File: # gedit/etc/firewall. shiptables-Fiptables-NFIREWALLiptables-FFIREWALLiptables-AINPUT-jFIREWALLiptables-AFORWARD-jFIREWALLiptables-AFIREWALL write the following commands in firewall. sh file:
# Gedit/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 is configured with a fire wall.
Clear command: iptables-F
View command: iptables-L

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.