Linux VPS Firewall Script SS vp,n WEB MYSQL SSH

Source: Internet
Author: User
Tags vps

iptables-f
iptables-a input-i lo-j ACCEPT
iptables-a output-j ACCEPT
iptables-a input-m State--state related,established-j ACCEPT
iptables-a input-p tcp--dport 80-j ACCEPT
iptables-a input-p tcp--dport 222-j ACCEPT

iptables-a input-p tcp--dport 1723-j ACCEPT
iptables-a input-p gre-j ACCEPT
//These 2 are the PPTP buttresses.

iptables-a input-p tcp--dport 40000:60000-j ACCEPT
//ss Open Port


iptables-a input-s 11.11.11.11-p tcp--dport 3306-j ACCEPT

iptables-a input-s 101.199.100.150-p UDP--dport 161-j ACCEPT
//SNMPD Monitoring

iptables-a output-p tcp-m multiport--dports 25,26,109,110,143,220,366,465,587,691,993,995,2710,6881-j REJECT--r Eject-with Tcp-reset
iptables-a output-p udp-m multiport--dports 25,26,109,110,143,220,366,465,587,691,993,995,2710,6881-j DROP
//Shielded SS hair junk e-mail

iptables-a input-p icmp-j ACCEPT
iptables-a output-p icmp-j ACCEPT

iptables-a input-j DROP
/etc/init.d/iptables Save


iptables-a forward-s 172.16.36.0/24-p tcp-m tcp--tcp-flags fin,syn,rst,ack syn-j tcpmss--SET-MSS 1356
iptables-t nat-a postrouting-s 172.16.36.0/24-j SNAT--to-source 111.111.111.111
//These 2 are forwarded by PPTP wall

Linux VPS Firewall Script SS vp,n WEB MYSQL SSH

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.