X-Git-Url: http://lab.mitty.jp/git/?a=blobdiff_plain;ds=sidebyside;f=iptables%2Fsetlan2wan.sh;fp=iptables%2Fsetlan2wan.sh;h=0000000000000000000000000000000000000000;hb=8333ea00a9fe608c90c20af12ea0c51548f66f4e;hp=55949494d700a862d0520819ea9b5322b10a15fa;hpb=920ad9e17feea13643c407944f9452b03bd45b6e;p=lab.git diff --git a/iptables/setlan2wan.sh b/iptables/setlan2wan.sh deleted file mode 100644 index 5594949..0000000 --- a/iptables/setlan2wan.sh +++ /dev/null @@ -1,35 +0,0 @@ -#!/bin/sh - -# enable access to WAN device on router node from LAN clients -# - -set -x - -## INTERFACES(5) -# IFACE physical name of the interface being processed -# METHOD method of the interface (e.g., static) -# MODE start if run from ifup, stop if run from ifdown -# PHASE as per MODE, but with finer granularity, distinguishing the pre- -# up, post-up, pre-down and post-down phases. - -LANIF="${1:?"usage: $0 "}" -LANIP="${2:?"usage: $0 "}" - -WANIP=`/sbin/ip addr show dev ${IFACE} | grep -w inet | tr -s ' ' | cut -d ' ' -f 3 | cut -d / -f 1` - -if [ "${PHASE}" = "pre-down" ]; then - # delete rule and exit - /sbin/iptables -t nat -D PREROUTING -i ${LANIF} -d ${WANIP} -j DNAT --to-destination ${LANIP} - echo "remove rule for access to WAN device on router node from LAN clients" - exit -fi - - -# set rule -( -sleep 60 - -/sbin/iptables -t nat -A PREROUTING -i ${LANIF} -d ${WANIP} -j DNAT --to-destination ${LANIP} -echo "set rule for access to WAN device on router node from LAN clients" - -) &