summaryrefslogtreecommitdiffstats
path: root/rules/10-ar-amanojaku
blob: f36b584884580a77e9222c6d2bc3e0c17b57a428 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
#!/bin/bash
rules() {
    # tcp
    for port in 22 80 443 14528:14530 20000; do
        iptables -t nat $flag PREROUTING -i ${IF_WAN} -d ${HOST_KASHA_WAN} -p tcp --dport ${port} -j DNAT --to-destination ${HOST_AMANOJAKU}
        iptables -t filter $flag FORWARD -i ${IF_WAN} -d ${HOST_AMANOJAKU} -p tcp --dport ${port} -j ACCEPT
    done

    # udp
    for port in 60000:60100; do
        iptables -t nat $flag PREROUTING -i ${IF_WAN} -d ${HOST_KASHA_WAN} -m udp -p udp --dport ${port} -j DNAT --to-destination ${HOST_AMANOJAKU}
        iptables -t filter $flag FORWARD -i ${IF_WAN} -d ${HOST_AMANOJAKU} -m udp -p udp --dport ${port} -j ACCEPT
    done
}