diff options
author | punk <punk@libernaut> | 2021-04-21 15:26:19 +0100 |
---|---|---|
committer | punk <punk@libernaut> | 2021-04-21 15:26:19 +0100 |
commit | eac48b5a8d709135a95abcc2243b369095f074f4 (patch) | |
tree | a2e34d995cef5ac8068ec7047e93b1125c80d175 /linux/conf/iptables/ipt-conf.sh | |
parent | 3bd43803fc8cb7a39a87394cb7c491ddc151e06b (diff) | |
parent | 452477a2635d85ecf772a5242ce97d9479503bb3 (diff) | |
download | doc-eac48b5a8d709135a95abcc2243b369095f074f4.tar.gz |
release 0.7.0
Diffstat (limited to 'linux/conf/iptables/ipt-conf.sh')
-rw-r--r-- | linux/conf/iptables/ipt-conf.sh | 47 |
1 files changed, 47 insertions, 0 deletions
diff --git a/linux/conf/iptables/ipt-conf.sh b/linux/conf/iptables/ipt-conf.sh new file mode 100644 index 0000000..8d57f5f --- /dev/null +++ b/linux/conf/iptables/ipt-conf.sh @@ -0,0 +1,47 @@ +#!/bin/bash + +IPT="/usr/sbin/iptables" +IPT6="/usr/sbin/ip6tables" + +SPAMLIST="/etc/iptables/blockedip" +SPAMDROPMSG="BLOCKED IP: " + +#TYPE=bridge +#TYPE=server +#TYPE=open +TYPE=client + +# bridge interface with interface facing gateway +#BR_IF="br0" + +# bridge ip network address +BR_NET="10.0.0.0/8" +#BR_NET="192.0.0.0/8" +# static wifi ip network address +#WIFI_NET="10.0.0.0/8" + +# network gateway +#GW="10.0.0.1" +GW=$(ip route | grep "default via" | cut -d " " -f 3) + +# external dns +#DNS="10.0.0.254" +#DNS=$(grep -m 1 "nameserver " /etc/resolv.conf | cut -d " " -f 2) +DNS=$(grep -m 1 "^server=" /etc/dnsmasq.conf | cut -d "=" -f 2) + +# public interface facing gateway +#PUB_IF="wlp9s0" +PUB_IF="enp7s0" + +# wifi interface +#WIFI_IF="wlp7s0" + +# static machine ip address +#PUB_IP="10.0.0.4" +# deserve much better :( +PUB_IP=$(ifconfig ${PUB_IF} | grep -m 1 "addr:" | cut -d " " -f 12 | cut -d ":" -f 2) + +echo "GW: ${GW}" +echo "DNS: ${DNS}" +echo "PUB_IF: ${PUB_IF}" +echo "PUB_IP: ${PUB_IP}" |