about summary refs log tree commit diff stats
path: root/linux/conf/iptables/ipt-server.sh
blob: a44568af197a7be4cf3c1e8a2c77168aa93a42a2 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
echo "setting server iptables ..."

####### Input Chain ######
$IPT -A INPUT -j blocker
$IPT -A INPUT -j blockip_in

$IPT -A INPUT -i ${PUB_IF} -s ${BR_NET} -p udp --dport 520 -j DROP

$IPT -A INPUT -i ${PUB_IF} -d ${PUB_IP} -s ${DNS} -j cli_dns_in
$IPT -A INPUT -i ${PUB_IF} -d ${PUB_IP} -s ${BR_NET} -j cli_http_in
$IPT -A INPUT -i ${PUB_IF} -d ${PUB_IP} -s ${BR_NET} -j cli_https_in
$IPT -A INPUT -i ${PUB_IF} -d ${PUB_IP} -s ${BR_NET} -j cli_ssh_in

$IPT -A INPUT -i ${PUB_IF} -d ${PUB_IP} -s ${BR_NET} -j srv_http_in
$IPT -A INPUT -i ${PUB_IF} -d ${PUB_IP} -s ${BR_NET} -j srv_https_in
$IPT -A INPUT -i ${PUB_IF} -d ${PUB_IP} -s ${BR_NET} -j srv_ssh_in
$IPT -A INPUT -i ${PUB_IF} -d ${PUB_IP} -s ${BR_NET} -j srv_git_in
$IPT -A INPUT -i ${PUB_IF} -d ${PUB_IP} -s ${BR_NET} -j srv_smtp_in

$IPT -A INPUT -i ${PUB_IF} -d ${PUB_IP} -j cli_https_in

$IPT -A INPUT -i ${PUB_IF} -d ${PUB_IP} -j srv_https_in
$IPT -A INPUT -i ${PUB_IF} -d ${PUB_IP} -j srv_http_in
$IPT -A INPUT -i ${PUB_IF} -d ${PUB_IP} -j srv_ssh_in
$IPT -A INPUT -i ${PUB_IF} -d ${PUB_IP} -j srv_git_in

####### Output Chain ######
$IPT -A OUTPUT -j blocker
$IPT -A OUTPUT -j blockip_out

$IPT -A OUTPUT -o ${PUB_IF} -d ${DNS} -s ${PUB_IP} -j cli_dns_out
$IPT -A OUTPUT -o ${PUB_IF} -d ${BR_NET} -s ${PUB_IP} -j cli_http_out
$IPT -A OUTPUT -o ${PUB_IF} -d ${BR_NET} -s ${PUB_IP} -j cli_ssh_out

$IPT -A OUTPUT -o ${PUB_IF} -d ${BR_NET} -s ${PUB_IP} -j srv_https_out
$IPT -A OUTPUT -o ${PUB_IF} -d ${BR_NET} -s ${PUB_IP} -j srv_http_out
$IPT -A OUTPUT -o ${PUB_IF} -d ${BR_NET} -s ${PUB_IP} -j srv_ssh_out
$IPT -A OUTPUT -o ${PUB_IF} -d ${BR_NET} -s ${PUB_IP} -j srv_smtp_out
$IPT -A OUTPUT -o ${PUB_IF} -d ${BR_NET} -s ${PUB_IP} -j srv_git_out

$IPT -A OUTPUT -o ${PUB_IF} -s ${PUB_IP} -j cli_https_out

$IPT -A OUTPUT -o ${PUB_IF} -s ${PUB_IP} -j srv_https_out
$IPT -A OUTPUT -o ${PUB_IF} -s ${PUB_IP} -j srv_http_out
$IPT -A OUTPUT -o ${PUB_IF} -s ${PUB_IP} -j srv_ssh_out
$IPT -A OUTPUT -o ${PUB_IF} -s ${PUB_IP} -j srv_git_out

## log everything else and drop
ipt_log