Shorewall firewall installation and configuration-Linux Enterprise Application-Linux server application information. The following is a detailed description. Environment Description: This machine only has one Nic and uses a static IP address to access the Internet.
Command: apt-get install shorewall ubuntu will automatically install it for you, but shorewall is neither configured nor started
[2] Modify/etc/shorewall. conf to STARTUP_ENABLED = No to STARTUP_ENABLED = Yes
[3] Modify/etc/default/shorewall to startup = 0 to startup = 1
[4] Run ifconfig to confirm that the default Nic name is eth0. Write down the NIC name
[5] Change/etc/shorewall/interfaces to net eth0 detect dhcp, tcpflags, logmartians, and eth0 in nosmurfs to your Nic name.
[6] modifying the/etc/shorewall/rules file is the definition file for access rules. By default, it allows local computers to access all external addresses, prohibit external computers from accessing this address. For example, if you open the ssh service and the port is 22, which of the following statements do you Want to allow others to access? Create a rule in ACCEPT $ FW net icmp?
ACCEPT net $ fw tcp 22. Here we will also briefly describe some of the rules. net represents an Internet computer. $ fw represents a local computer, that is, the firewall itself interprets ACCEPT net $ fw tcp 22, which means to allow the Internet to access the local machine (firewall) through the TCP protocol to access port 22. If it is disabled, it means DROP.
DROP net $ fw tcp 22 if it is to allow access from an IP address on the Internet, the rule can be written in this way.
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