iptables output block not local

Kernels & Hardware, configuring network, installing services

iptables output block not local

Postby pinhas_8947 » 2015-09-19 12:30

Hi

I try to create some rules to detect an outgoing traffic from my debian jessie that is not from my IP or loop. Can you please take a review this little script let me know what you think (okay, has bugs ...).
Thanks,

#!/bin/bash

/sbin/iptables -N C_OUT_N_LOCAL
/sbin/iptables -N C_OUT_N_LOCAL_LO

/sbin/iptables -A C_OUT_N_LOCAL -m limit --limit 2/min -j LOG --log-prefix "PK: output not local : " --log-level 4

LO_IP="127.0.0.1"
MY_IP="192.168.0.4"

/sbin/iptables -I OUTPUT -p ALL ! -s $LO_IP -j C_OUT_N_LOCAL_LO
/sbin/iptables -A C_OUT_N_LOCAL_LO -p ALL ! -s $MY_IP -j C_OUT_N_LOCAL
pinhas_8947
 
Posts: 10
Joined: 2015-08-19 12:26

Return to System configuration

Who is online

Users browsing this forum: No registered users and 8 guests

fashionable