Linux Server firewall Whitelist settings

Source: Internet
Author: User
Tags iptables

The company recently on the network security catch more strict, require firewall must be open, but the Project Server has five or six, three for load balancing, the server must be a variety of connections between, it can only be added by the whitelist.

Board the server, edit the firewall configuration file

  Vi/etc/sysconfig/iptables

  Add additional server IP addresses that need access to the server, and the port number that the server needs to open

As follows:

# Firewall configuration written by system-config-firewall# Manual customization of this file is not recommended.*filter:i Nput Accept [0:0]:forward Accept [0:0]:output accept [0:0] #这里开始增加白名单服务器ip (please remove the IP address of the current server)-N whitelist-a whitelist-s  192.168.111.xxx-j accept-a whitelist-s 192.168.111.xxx-j accept-a whitelist-s 192.168.111.xxx-j ACCEPT-A whitelist-s 192.168.111.xxx-j accept-a whitelist-s 192.168.111.xxx-j accept# here End Whitelist server ip-a input-m State--state ESTABLISHED,RELA TED -j ACCEPT-A INPUT -p icmp -j ACCEPT-A INPUT -i lo -j ACCEPT-A INPUT -m state --state NEW -m tcp -p tcp --dport 22 -j A CCEPT-A INPUT -m state --state NEW -m tcp -p tcp --dport 13020 -j ACCEPT-A INPUT -m state --state NEW -m tcp -p tcp --dpor T 1000:8000-j Accept//Open all ports between 1000 and 8000//above these ACCEPT port numbers, the public intranet can be accessed//below these whitelist port numbers, only between servers via intranet access # Add here for whitelist IP open Port-a input-m state--state new-m tcp-p TCP--dport 22-j whitelist-a input-m State--state new-m tcp-p TCP--dport 13009-j whitelist-a input-m State --state new-m tcp-p TCP--dport 10080-j whitelist# this ends for whitelist IP open Port-a input-j REJECT--reject-with icmp-host-prohibited- A forward-j REJECT--reject-with icmp-host-prohibitedcommit

When you're done editing, don't forget to restart the firewall

  Service Iptables Restart

Transferred from: http://www.cnblogs.com/yashi/p/7550669.html

Linux Server firewall Whitelist settings

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.