10 lines
269 B
Bash
10 lines
269 B
Bash
#!/bin/sh
|
|
|
|
export PATH=/sbin:/bin:/usr/sbin:/usr/bin
|
|
|
|
if [ "$IFACE" = "{{ interface }}" ]; then
|
|
{%- for fwd in ports %}
|
|
iptables -t nat -A PREROUTING -i {{ interface }} -p {{ fwd.proto }} --dport {{ fwd.port }} -j DNAT --to-destination {{ fwd.to }}
|
|
{%- endfor %}
|
|
fi
|