All pastes #241678 Raw Edit

Someone

public text v1 · immutable
·published 2006-11-06 14:13 UTC
rendered paste body
#!/bin/sh
. /etc/functions.sh

WAN=$(nvram get wan_ifname)
LAN=$(nvram get lan_ifname)

# Flush rules
iptables -F input_rule
iptables -F output_rule
iptables -F forwarding_rule
iptables -t nat -F prerouting_rule
iptables -t nat -F postrouting_rule

### Port forwarding

## Server traffic
# Website
iptables -t nat -A prerouting_rule -i $WAN -p tcp --dport 80 -j DNAT --to 192.168.1.5:80
iptables        -A forwarding_rule -i $WAN -p tcp --dport 80 -d 192.168.1.5 -j ACCEPT

# Email
iptables -t nat -A prerouting_rule -i $WAN -p tcp --dport 25 -j DNAT --to 192.168.1.5:25
iptables        -A forwarding_rule -i $WAN -p tcp --dport 25 -d 192.168.1.5 -j ACCEPT