From 9e2c799f9d188933b094dbad3f8cf4685e6a2023 Mon Sep 17 00:00:00 2001 From: henk Date: Wed, 26 Apr 2023 14:46:38 +0200 Subject: [PATCH] 2023-04-26 14:46:38 --- linux/nat/Route.sh | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100755 linux/nat/Route.sh diff --git a/linux/nat/Route.sh b/linux/nat/Route.sh new file mode 100755 index 0000000..a898953 --- /dev/null +++ b/linux/nat/Route.sh @@ -0,0 +1,13 @@ +#!/bin/bash + +sysctl net.ipv4.ip_forward=1 +IP4=192.168.200.0/244 # pas je iprange hier aan +IF=eth0 # uitgaande iface + +iptables -t nat -A POSTROUTING -s ${IP4} -o ${IF} -j MASQUERADE +iptables -A FORWARD -s -s ${IP4} -o ${IF} -j ACCEPT +iptables -A FORWARD -d ${IP4} -m state \ + --state ESTABLISHED,RELATED -i ${IF} -j ACCEPT + +# zet in crontab +#@reboot bash /root/Route.sh # zonder eerste #