Skip to content

Commit c067535

Browse files
author
Harshil Jethava
committed
Advance Firewall and Network Security
1 parent 7811e07 commit c067535

File tree

3 files changed

+37
-0
lines changed

3 files changed

+37
-0
lines changed

Diff for: Chapter32/firewall-cmd_NAT

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# Network Address Translation can be achieved in two ways:
2+
1 masquerade
3+
2 port forwarding
4+
5+
# masquerade
6+
firewall-cmd --permanent --zone=example --add-rich-rule='rule family=ipv4 source address=192.168.0.0/24 masquerade'
7+
8+
# port forwarding
9+
firewall-cmd --permanent --zone=public --add-forward-port=port=420:proto=tcp:toport=8080:toaddr=192.168.0.120
10+

Diff for: Chapter32/logging_example

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
# log to syslog for ssh service at rate of 3 logs per mintue
2+
firewall-cmd --permanent --zone=work --add-rich-rules='rule service name="ssh" log prefix="ssh" level="notice" limit value="3/m" accept'
3+
4+

Diff for: Chapter32/rich_rules_logging

+23
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# syslog or auditd with these two options rich rules can be implemented as to trace accepted or rejected connections
2+
3+
# logging syntax
4+
log [prefix="<PREFIX TEXT>"] [level=<LOGLEVEL>] [limit value="<RATE/DURATION>"]
5+
6+
# LOGLEVEL can be:
7+
emerg
8+
alert
9+
crit
10+
error
11+
warning
12+
notice
13+
info
14+
debug
15+
16+
# DURATION can be:
17+
s
18+
m
19+
h
20+
21+
22+
23+

0 commit comments

Comments
 (0)