Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
O
openwrt
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Freifunk Luebeck
openwrt
Commits
ada8e5dd
Commit
ada8e5dd
authored
17 years ago
by
Florian Fainelli
Browse files
Options
Downloads
Patches
Plain Diff
Only masquerade LAN, other settings need manual tweaking
SVN-Revision: 9461
parent
304d5c88
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
package/iptables/files/firewall.init
+5
-4
5 additions, 4 deletions
package/iptables/files/firewall.init
with
5 additions
and
4 deletions
package/iptables/files/firewall.init
+
5
−
4
View file @
ada8e5dd
...
...
@@ -11,6 +11,9 @@ start() {
config_get WAN wan ifname
config_get WANDEV wan device
config_get LAN lan ifname
config_get LAN_MASK lan netmask
config_get LAN_IP lan ipaddr
LAN_NET
=
$(
/bin/ipcalc.sh
$LAN_IP
$LAN_MASK
|
grep
NETWORK |
cut
-d
=
-f2
)
## CLEAR TABLES
for
T
in
filter nat
;
do
...
...
@@ -105,10 +108,8 @@ start() {
iptables
-t
nat
-A
PREROUTING
-j
prerouting_rule
[
-z
"
$WAN
"
]
||
iptables
-t
nat
-A
PREROUTING
-i
"
$WAN
"
-j
prerouting_wan
iptables
-t
nat
-A
POSTROUTING
-j
postrouting_rule
### Only RFC1918 addresses
[
-z
"
$WAN
"
]
||
iptables
-t
nat
-A
POSTROUTING
--src
192.168.0.0/16
-o
$WAN
-j
MASQUERADE
[
-z
"
$WAN
"
]
||
iptables
-t
nat
-A
POSTROUTING
--src
172.16.0.0/12
-o
$WAN
-j
MASQUERADE
[
-z
"
$WAN
"
]
||
iptables
-t
nat
-A
POSTROUTING
--src
10.0.0.0/8
-o
$WAN
-j
MASQUERADE
### Only LAN
[
-z
"
$WAN
"
]
||
iptables
-t
nat
-A
POSTROUTING
--src
$LAN_NET
/
$LAN_MASK
-o
$WAN
-j
MASQUERADE
iptables
-t
nat
-A
NEW
-m
limit
--limit
50
--limit-burst
100
-j
RETURN
&&
\
iptables
-t
nat
-A
NEW
-j
DROP
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment