May 2020
M T W T F S S
« Mar    
 123
45678910
11121314151617
18192021222324
25262728293031

Categories

WordPress Quotes

History is a relentless master. It has no present, only the past rushing into the future. To try to hold fast is to be swept aside.
John F. Kennedy
May 2020
M T W T F S S
« Mar    
 123
45678910
11121314151617
18192021222324
25262728293031

Short Cuts

2012 SERVER (64)
2016 windows (9)
AIX (13)
Amazon (40)
Ansibile (19)
Apache (135)
Asterisk (2)
cassandra (2)
Centos (211)
Centos RHEL 7 (270)
centos8 (3)
chef (3)
cloud (2)
cluster (3)
Coherence (1)
DB2 (5)
DISK (25)
DNS (9)
Docker (30)
Eassy (11)
ELKS (1)
EXCHANGE (3)
Fedora (6)
ftp (5)
GIT (3)
GOD (2)
Grub (1)
Hacking (10)
Hadoop (6)
health (2)
horoscope (23)
Hyper-V (10)
IIS (15)
IPTABLES (15)
JAVA (7)
JBOSS (32)
jenkins (1)
Kubernetes (7)
Ldap (5)
Linux (188)
Linux Commands (166)
Load balancer (5)
mariadb (14)
Mongodb (4)
MQ Server (24)
MYSQL (84)
Nagios (5)
NaturalOil (13)
Nginx (35)
Ngix (1)
openldap (1)
Openstack (6)
Oracle (35)
Perl (3)
Postfix (19)
Postgresql (1)
PowerShell (2)
Python (3)
qmail (36)
Redis (12)
RHCE (28)
SCALEIO (1)
Security on Centos (29)
SFTP (1)
Shell (64)
Solaris (58)
Sql Server 2012 (4)
squid (3)
SSH (10)
SSL (14)
Storage (1)
swap (3)
TIPS on Linux (28)
tomcat (62)
Ubuntu (1)
Uncategorized (30)
Veritas (2)
vfabric (1)
VMware (28)
Weblogic (38)
Websphere (71)
Windows (19)
Windows Software (2)
wordpress (1)
ZIMBRA (17)

WP Cumulus Flash tag cloud by Roy Tanck requires Flash Player 9 or better.

Who's Online

0 visitors online now
0 guests, 0 bots, 0 members

Hit Counter provided by dental implants orange county

Shorewall Firewall

Installing and configuring Shorewall in CentOS

Netfilter is a packet filtering in Linux 2.4.x and 2.6.x kernels Enables packet filtering (network address and port), NAT and other packages. Redesigned and highly improved from the previous kernel 2.2.x, ipchains and ipfwadm kernel 2.0.x.

Netfilter is a set of structures within the kernel that allows modules to register with the network functions.

A record of the information is returned to tell the fate of this package. DENY, ACCEPT, REJECT is returned information to inform the target / request.

DROP – Reject the packet without sending a message.

REJECT – Do the same function as DROP, with the difference that sends an ICMP “icmp-port-unreachable” to the source machine.

Iptables is a table structure for the definition of rulesets. Each rule within a table (IP) consists of a request and action (rules).

Netfilter, ip_tables, connection tracking (ip_conntrack, nf_conntrack) and NAT are subsystems together to build the main parts of the structure.

Reference: http://www.netfilter.org

 

Shoreline Firewall (netfilter)
Site Developer: www.shorewall.net / index.htm
Go to Documentation (Documentation) that there is going item by item and include other things that can add to Shorewall.
Using the “shorewall” you will be using iptables, but in an easier way.

 

yum install shorewall

Checking the processes that are to be started during reboot:

# Chkconfig – list

iptables 0: off 1: off 2: on 3: on 4: on 5: on 6: off
shorewall 0: off 1: off 2: off 3: off 4: off 5: off 6: off

Note that Shorewall is off. That is, every time the machine is rebooted, Shorewall will not rise.

# Chkconfig shorewall on

Leaving it (shorewall) enabled looks like this:

shorewall 0: off 1: off 2: on 3: on 4: on 5: on 6: off

Shorewall configuration files:

/ etc / shorewall / shorewall.conf
/ etc / shorewall / interfaces
/ etc / shorewall / masq
/ etc / shorewall / policy
/ etc / shorewall / rules
/ etc / shorewall / zones

where:

interfaces – each interface definition that will
masq – Definition of Masquerade / SNAT (eth0, eth1, eth2 …)
Police – Policies (ACCEPT, DROP, REJECT …)
rules – Firewall Rules
zones – zones Statement

 

Configuring Shorewall
Change in shorewall.conf:

STARTUP_ENABLED=Yes

SHOREWALL_COMPILER=

SHOREWALL_COMPILER=perl

 

cat /etc/shorewall/interfaces

#
# Shorewall version 4 – Interfaces File
#
# For information about entries in this file, type “man shorewall-interfaces”
#
# The manpage is also online at
# http://www.shorewall.net/manpages/shorewall-interfaces.html
#
#######################################
#ZONE   INTERFACE       BROADCAST       OPTIONS
net     eth0      detect        tcpflags,dhcp,routefilter,nosmurfs,logmartians
loc     eth1      detect        tcpflags,nosmurfs
#LAST LINE — ADD YOUR ENTRIES BEFORE THIS ONE — DO NOT REMOVE# cat masq
#
# Shorewall version 4 – Masq file
#
# For information about entries in this file, type “man shorewall-masq”
#
# The manpage is also online at
# http://www.shorewall.net/manpages/shorewall-masq.html
#
#######################################
#INTERFACE              SOURCE          ADDRESS         PROTO   PORT(S) IPSEC   MARK
eth0    203.x.x.x
eth0:1  203.y.y.y
eth1    10.x.y.z
#LAST LINE — ADD YOUR ENTRIES ABOVE THIS LINE — DO NOT REMOVE

Note: Read the fine manual, has several options to configure.

 

cat policy

#
# Shorewall version 4 – Policy File
#
# For information about entries in this file, type “man shorewall-policy”
#
# The manpage is also online at
# http://www.shorewall.net/manpages/shorewall-policy.html
#
#######################################
#SOURCE         DEST            POLICY          LOG             LIMIT:BURST
fw      loc     ACCEPT
fw      net     ACCEPT
fw      fw      ACCEPTloc     fw      ACCEPT
loc     net     ACCEPT
loc     loc     ACCEPTnet     fw      DROP    info
net     loc     DROP    info
net     net     DROP    info

all     all     DROP    info
#                                               LEVEL
#LAST LINE — DO NOT REMOVE

Note: I left that last line (all all DROP info) because I decree that passes and does not pass the firewall and will generate a log of what is.
cat rules

#
# Shorewall version 4 – Rules File
#
# For information on the settings in this file, type “man shorewall-rules”
#
# The manpage is also online at
# http://www.shorewall.net/manpages/shorewall-rules.html
#
############################################
#ACTION         SOURCE          DEST            PROTO   DEST    SOURCE          ORIGINAL        RATE            USER/   MARK
#                                                       PORT    PORT(S)         DEST            LIMIT           GROUP
#SECTION ESTABLISHED
#SECTION RELATED
SECTION NEW### NET to FWACCEPT  net     fw   icmp  echo-request
ACCEPT  net     fw   tcp   80
ACCEPT  net     fw   tcp   22

### LOC to FW

ACCEPT  loc     fw   tcp   ssh
ACCEPT  loc     fw   icmp  echo-request
ACCEPT  loc     fw   udp   snmp

### LOC to NET

ACCEPT  loc     net  udp   domain
ACCEPT  loc     net  tcp   domain
ACCEPT  loc     net  tcp   http,https
ACCEPT  loc     net  icmp  echo-request
#LAST LINE — ADD YOUR ENTRIES BEFORE THIS ONE — DO NOT REMOVE

# cat zones
#
# Shorewall version 4 – Zones File
#
# For information about this file, type “man shorewall-zones”
#
# The manpage is also online at
# http://www.shorewall.net/manpages/shorewall-zones.html
#
#######################################
#ZONE   TYPE            OPTIONS         IN                      OUT
#                                       OPTIONS                 OPTIONS
fw      firewall
net     ipv4
loc     ipv4
#LAST LINE – ADD YOUR ENTRIES ABOVE THIS ONE – DO NOT REMOVE

# service shorewall start

If you get any error:# Restart shorewall debugYou can check where the error is giving informed.

Leave a Reply

You can use these HTML tags

<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>

  

  

  

Blue Captcha Image
Refresh

*

Protected by WP Anti Spam