iptables Firewall Configuration Tool Shorewall Advanced Practical Introduction

Source: Internet
Author: User
Tags variables ssh iptables firewall

In the previous installment and use example of the Iptables firewall Configuration tool Shorewall, we described how to install and use the Shorewall tool for firewall configuration, and in this article we will give you an example of some of its advanced components.

Introduction of Advanced Components

1, params

This is a file that is used to set up a shell variable, which is a bit like the include feature in C, which puts the variables of the file included in the file, but does not need to be introduced in the Shorewall profile, Params The purpose of this file is to set all the relevant variables in a unified, when your rules are all set up, as long as the change of params content can be applied to other network state, management is very convenient, the following is an example:

在/etc/shorewall/params中的设定:
NET_IF=eth0 NET_BCAST=130.252.100.255
NET_OPTIONS=blacklist,norfc1918
在/etc/shorewall/interfaces中的设定:
net$NET_IF$NET_BCAST$NET_OPTIONS

In this way, other rules can be written in the form of variables, so the rules can be reused once they are written.

2. Rules

This file is the key file of the entire Shorewall, policy file is designed to develop the entire firewall policy, such as Loc the interface to the DMZ policy is reject or accept, usually from outside the firewall to the internal network policy is all set first to shut down. And the rules of the file is in the development of some "exceptional" situation, for example, your firewall will be all the port to shut down, so that the outside can not be connected by SSH, then this time can be defined in the rules of the file, its format is as follows:

#ACTIONSOURCEDESTPROTODESTSOURCEORIGINAL
#PORTPORT(S)DEST
DNAT fw loc:192.168.1.3 tcp ssh,http



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.