#!/bin/bash

[ -x $IPTABLES ] || exit 43

# ----------------------------- ROUTING -------------------------------

    $IPTABLES -t nat -F route_post
    $IPTABLES -t nat -F route_pre
    $IPTABLES -t nat -F filter_out

# routing gw tunnel
    #$IPTABLES -t nat -A route_post -s $VPN_GWSUB -o $INETIF -j SNAT --to 79.172.192.91

# MASQ
    #$IPTABLES -t nat -A route_post -s 192.168.0.0/24 -o ppp0 -j MASQUERADE

# Routing (SNAT)
    #$IPTABLES -t nat -A route_post -s 192.168.0.0/24 -o $INETIF -j SNAT --to 192.168.1.222

# VPN route
    #$IPTABLES -t nat -A route_post -s $LANSUB -o $VPN_LANIF -j SNAT --to $VPN_LANIP
    #$IPTABLES -t nat -A route_post -s $VPN_LANSUB -o $LANIF -d $LANSUB -j SNAT --to $LANIP
    #$IPTABLES -t nat -A route_post -s $VPN_LANSUB -o $LANIF -j SNAT --to 192.168.6.42

# INET 121 -> 21 (FTP workaround)
    $IPTABLES -t nat -A route_pre -i $INETIF -p tcp --dport 121 -j REDIRECT --to-port 21

# localhost 21 -> 2121 (non-TLS FTP)
    #$IPTABLES -t nat -A filter_out -s 127.0.0.1 -d 127.0.0.1 -p tcp --dport 21 -j REDIRECT --to-port 2121
