You are on page 1of 1

#!/bin/sh PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin NAME=firewall DESC="Routing - NAT - SSH" # Indirizzo IP della eth1 del firewall EXTERNIP="192.168.1.

250" # La macchina della rete che risponde alle richieste SSH SSHHOST="10.31.219.220" # Il range IP della LAN LOCALNET="10.31.219.0/24" case "$1" in start) iptables -t nat -A POSTROUTING -d ! ${LOCALNET} -j SNAT --to ${EXTERNIP} iptables -t nat -A PREROUTING --dst ${EXTERNIP} -p tcp --dport 22 -j DNA T --to-destination ${SSHHOST} echo 1 > /proc/sys/net/ipv4/conf/all/forwarding ;; stop) echo 0 > /proc/sys/net/ipv4/conf/all/forwarding iptables -t nat -F ;; *) N=/etc/init.d/$NAME echo "Usage: $N {start|stop}" >&2 exit 1 ;; esac exit 0 b2ag3hn9trgtqt0635vvpenw

You might also like