18
SHOREWALL By Dhoto Revised by Idris

SHOREWALL By Dhoto Revised by Idris. Shorewall tools for building a firewall variable : interfaces, zones, rules

Embed Size (px)

Citation preview

Page 1: SHOREWALL By Dhoto Revised by Idris. Shorewall  tools for building a firewall  variable : interfaces, zones, rules

SHOREWALL

By DhotoRevised by Idris

Page 2: SHOREWALL By Dhoto Revised by Idris. Shorewall  tools for building a firewall  variable : interfaces, zones, rules

Shorewall

Shorewall tools for building a firewall variable : interfaces, zones, rules

Page 3: SHOREWALL By Dhoto Revised by Idris. Shorewall  tools for building a firewall  variable : interfaces, zones, rules

Shorewall

Page 4: SHOREWALL By Dhoto Revised by Idris. Shorewall  tools for building a firewall  variable : interfaces, zones, rules

Interfaces

# ifconfig --> eth0

Page 5: SHOREWALL By Dhoto Revised by Idris. Shorewall  tools for building a firewall  variable : interfaces, zones, rules

Zones

Your network --> Net Your Server --> fw

Page 6: SHOREWALL By Dhoto Revised by Idris. Shorewall  tools for building a firewall  variable : interfaces, zones, rules

Rules

from fw to Net --> Ok / Accept from Net to fw --> access denied / drop from other --> access denied / drop

Page 7: SHOREWALL By Dhoto Revised by Idris. Shorewall  tools for building a firewall  variable : interfaces, zones, rules

Installation

Remove :~# apt-get remove portmap :~# apt-get remove nfs-common :~# apt-get remove pidentd

Page 8: SHOREWALL By Dhoto Revised by Idris. Shorewall  tools for building a firewall  variable : interfaces, zones, rules
Page 9: SHOREWALL By Dhoto Revised by Idris. Shorewall  tools for building a firewall  variable : interfaces, zones, rules

Installation

Install text editor :~# apt-get install vim :~# apt-get install mc

Page 10: SHOREWALL By Dhoto Revised by Idris. Shorewall  tools for building a firewall  variable : interfaces, zones, rules

Installation

Install iptables :~# apt-get install iptables

watch your firewall :~# iptables -nL

Page 11: SHOREWALL By Dhoto Revised by Idris. Shorewall  tools for building a firewall  variable : interfaces, zones, rules

Installation

Install Shorewall :~# apt-get remove –purge shorewall :~# apt-get install shorewall

Install documentation :~# apt-get remove –purge shorewall :~# apt-get install shorewall-doc

Page 12: SHOREWALL By Dhoto Revised by Idris. Shorewall  tools for building a firewall  variable : interfaces, zones, rules

Configuration goto shorewall directory

:~# cd /etc/shorewall look inside

:/etc/shorewall# ls :/etc/shorewall# iptables -nL

Page 13: SHOREWALL By Dhoto Revised by Idris. Shorewall  tools for building a firewall  variable : interfaces, zones, rules

Configuration

copy example from shorewall examples # cp /usr/share/doc/shorewall/examples/one-

interface/* /etc/shorewall/ # cd /etc/shorewall/ # gunzip *.gz

Page 14: SHOREWALL By Dhoto Revised by Idris. Shorewall  tools for building a firewall  variable : interfaces, zones, rules

Configuration

Change /etc/default/shorewall from

startup=0

to

startup=1 # vim /etc/default/shorewall

change the startup

Page 15: SHOREWALL By Dhoto Revised by Idris. Shorewall  tools for building a firewall  variable : interfaces, zones, rules

Activate the firewall

do this

# /etc/init.d/shorewall start watch your firewall

# iptables –nL | less

Page 16: SHOREWALL By Dhoto Revised by Idris. Shorewall  tools for building a firewall  variable : interfaces, zones, rules

RFC1918 for Private IP

default shorewall allow Public-IP # vim /etc/shorewall/interfaces

remove norfc1918 net eth0 detect

norfc1918,routefilter,dhcp,tcpflags to

net eth0 detect routefilter,dhcp,tcpflags

Page 17: SHOREWALL By Dhoto Revised by Idris. Shorewall  tools for building a firewall  variable : interfaces, zones, rules

activate some connection on rules

permit http connection to server #vim /etc/shorewall/rules

get to the bottom, add the rules ACCEPT all fw tcp 80

Restart the firewall # /etc/init.d/shorewall restart

Page 18: SHOREWALL By Dhoto Revised by Idris. Shorewall  tools for building a firewall  variable : interfaces, zones, rules

Thank you