summaryrefslogtreecommitdiff
path: root/inventory/host_vars/ch-router.yml
diff options
context:
space:
mode:
authorChristian Pointner <equinox@spreadspace.org>2019-07-16 19:55:12 +0200
committerChristian Pointner <equinox@spreadspace.org>2019-07-16 19:55:12 +0200
commit3da72a751fe54369d6dda9c6746eb888d128302a (patch)
tree3a7edfb47458ca7db52a3d2298285472428e4799 /inventory/host_vars/ch-router.yml
parentfix firewall of router (allow ssh from internal nets) (diff)
ch-router: make firewall script a little bit nicer
Diffstat (limited to 'inventory/host_vars/ch-router.yml')
-rw-r--r--inventory/host_vars/ch-router.yml8
1 files changed, 5 insertions, 3 deletions
diff --git a/inventory/host_vars/ch-router.yml b/inventory/host_vars/ch-router.yml
index 5394c4d6..fe313d87 100644
--- a/inventory/host_vars/ch-router.yml
+++ b/inventory/host_vars/ch-router.yml
@@ -66,7 +66,7 @@ openwrt_mixin:
SSH_PORT=$(uci get dropbear.@dropbear[0].Port)
- ## Local Traffic
+ ## Local/Management Traffic
#
iptables -A INPUT -i lo -d 127.0.0.0/8 -s 127.0.0.0/8 -j ACCEPT
iptables -A INPUT -i "$MGMT_IF" -d "$MGMT_IPADDR" -s "$MGMT_IPADDR/$MGMT_NETMASK" -j ACCEPT
@@ -84,11 +84,13 @@ openwrt_mixin:
## LAN Traffic
#
- iptables -A INPUT -i "$SVC_IF" -p icmp -d "$SVC_IPADDR" -s 192.168.0.0/16 -j ACCEPT
- iptables -A INPUT -i "$SVC_IF" -d "$SVC_IPADDR" -p tcp --dport "$SSH_PORT" -j ACCEPT
+ iptables -A INPUT -i "$SVC_IF" -d "$SVC_IPADDR" -s 192.168.0.0/16 -p icmp -j ACCEPT
+ iptables -A INPUT -i "$SVC_IF" -d "$SVC_IPADDR" -s 192.168.0.0/16 -p tcp --dport "$SSH_PORT" -j ACCEPT
iptables -A INPUT -i "$SVC_IF" -m conntrack --ctstate RELATED,ESTABLISHED -j ACCEPT
+
iptables -A FORWARD -i "$SVC_IF" -o "$MAGENTA_IF" -s 192.168.0.0/16 -j ACCEPT
iptables -A FORWARD -i "$MAGENTA_IF" -o "$SVC_IF" -m conntrack --ctstate RELATED,ESTABLISHED -j ACCEPT
+
iptables -t nat -A POSTROUTING -o "$MAGENTA_IF" -s 192.168.0.0/16 -j SNAT --to "$MAGENTA_IPADDR"