source: freewrt/package/iptables/files/firewall.user@ 8b53bd7

freewrt_1_0 freewrt_2_0
Last change on this file since 8b53bd7 was 475ad56, checked in by Waldemar Brodkorb <wbx@…>, 20 years ago

add OpenWrt trunk revision 3830.

git-svn-id: svn://www.freewrt.org/trunk/freewrt@1 afb5a338-a214-0410-bd46-81f09a774fd1

  • Property mode set to 100755
File size: 1.1 KB
Line 
1#!/bin/sh
2. /etc/config/network
3
4WAN="$wan_ifname"
5LAN="$lan_ifname"
6
7iptables -F input_rule
8iptables -F output_rule
9iptables -F forwarding_rule
10iptables -t nat -F prerouting_rule
11iptables -t nat -F postrouting_rule
12
13### BIG FAT DISCLAIMER
14## The "-i $WAN" is used to match packets that come in via the $WAN interface.
15## it WILL NOT MATCH packets sent from the $WAN ip address -- you won't be able
16## to see the effects from within the LAN.
17
18### Open port to WAN
19## -- This allows port 22 to be answered by (dropbear on) the router
20# iptables -t nat -A prerouting_rule -i $WAN -p tcp --dport 22 -j ACCEPT
21# iptables -A input_rule -i $WAN -p tcp --dport 22 -j ACCEPT
22
23### Port forwarding
24## -- This forwards port 8080 on the WAN to port 80 on 192.168.1.2
25# iptables -t nat -A prerouting_rule -i $WAN -p tcp --dport 8080 -j DNAT --to 192.168.1.2:80
26# iptables -A forwarding_rule -i $WAN -p tcp --dport 80 -d 192.168.1.2 -j ACCEPT
27
28### DMZ
29## -- Connections to ports not handled above will be forwarded to 192.168.1.2
30# iptables -t nat -A prerouting_rule -i $WAN -j DNAT --to 192.168.1.2
31# iptables -A forwarding_rule -i $WAN -d 192.168.1.2 -j ACCEPT
Note: See TracBrowser for help on using the repository browser.