Talk:Iptables command
From DD-WRT Wiki
Revision as of 02:17, 20 July 2007 (edit) Wildblue (Talk | contribs) m (Reverted edits by Devu6ka3 (Talk); changed back to last version by BrainSlayer) ← Previous diff |
Revision as of 02:17, 1 August 2007 (edit) (undo) Urule99 (Talk | contribs) (→Save iptables) Next diff → |
||
Line 4: | Line 4: | ||
Can we please get info on how to save iptables so they are restored on reboot? Thanks --[[User:Shibz|Shibz]] 09:30, 23 Jan 2007 (CET) | Can we please get info on how to save iptables so they are restored on reboot? Thanks --[[User:Shibz|Shibz]] 09:30, 23 Jan 2007 (CET) | ||
+ | |||
+ | |||
+ | I think dd-wrt stores the config using nvram, which doesn't seem to store formats for custom iptables commands. | ||
+ | # nvram get forward_spec | ||
+ | SSH:on:both:22>10.1.99.134:22 HTTP:on:both:8080>10.1.99.134:80 FTP:on:both:21>10.1.99.134:21 VM:on:both:902>10.1.99.134:902 | ||
+ | From this, it seems like you are better off doing a startup script with either rc_startup or by the http interface. | ||
+ | The http interface by accessing '''Administration''' -> '''Commands''' | ||
+ | The rc_startup method is also available: | ||
+ | # nvram get rc_startup | ||
+ | <existing commands> | ||
+ | # nvram set rc_startup=" | ||
+ | <existing commands> | ||
+ | <command 1> | ||
+ | <command 2> | ||
+ | ... | ||
+ | <command n> | ||
+ | " | ||
+ | There is a nice example iptables script for a different purpose here: [http://www.dd-wrt.com/wiki/index.php/Dual-WAN_for_simple_round-robin_load_equalization] | ||
+ | --[[User:Urule99|Urule99]] 04:17, 1 August 2007 (CEST) |
Revision as of 02:17, 1 August 2007
Where do we put IPtable rules should be added?
Save iptables
Can we please get info on how to save iptables so they are restored on reboot? Thanks --Shibz 09:30, 23 Jan 2007 (CET)
I think dd-wrt stores the config using nvram, which doesn't seem to store formats for custom iptables commands.
- nvram get forward_spec
SSH:on:both:22>10.1.99.134:22 HTTP:on:both:8080>10.1.99.134:80 FTP:on:both:21>10.1.99.134:21 VM:on:both:902>10.1.99.134:902 From this, it seems like you are better off doing a startup script with either rc_startup or by the http interface. The http interface by accessing Administration -> Commands The rc_startup method is also available:
- nvram get rc_startup
<existing commands>
- nvram set rc_startup="
<existing commands>
<command 1> <command 2> ... <command n> "
There is a nice example iptables script for a different purpose here: [1] --Urule99 04:17, 1 August 2007 (CEST)