POSTROUTING rule - where? (from Multiple WLANs Wiki)

Post new topic   Reply to topic    DD-WRT Forum Index -> Advanced Networking
Author Message
noname0815
DD-WRT Novice


Joined: 06 Jan 2009
Posts: 13

PostPosted: Sat Apr 14, 2012 6:19    Post subject: POSTROUTING rule - where? (from Multiple WLANs Wiki) Reply with quote
Hi,

the Multiple WLANs Wiki (http://www.dd-wrt.com/wiki/index.php/Multiple_WLANs) says:

Enable NAT on the WAN port to correct a bug in builds over 17000
iptables -t nat -I POSTROUTING -o `get_wanface` -j SNAT --to `nvram get wan_ipaddr`

This works. But only until the ISP gives me a new ip address.

Where should I place this statement so that it gets executed whenever my ip address changes? Is there a recommended way to handle this?

(Btw, using 18777. Are there any plans to fix this bug?)

Thanks - NN
Sponsor
phuzi0n
DD-WRT Guru


Joined: 10 Oct 2006
Posts: 10141

PostPosted: Mon Apr 16, 2012 3:52    Post subject: Reply with quote
As the guide explains, save it to the firewall script on the admin->commands page.
_________________
Read the forum announcements thoroughly! Be cautious if you're inexperienced.
Available for paid consulting. (Don't PM about complicated setups otherwise)
Looking for bricks and spare routers to expand my collection. (not interested in G spec models)
noname0815
DD-WRT Novice


Joined: 06 Jan 2009
Posts: 13

PostPosted: Mon Apr 16, 2012 8:52    Post subject: Reply with quote
The problem is that each time the WAN IP address changes the rule becomes invalid (sometimes even deleted automatically).
So I need to renew it each time if the WAN IP changes.
routvol
DD-WRT User


Joined: 02 Feb 2009
Posts: 87

PostPosted: Mon Apr 16, 2012 10:02    Post subject: Reply with quote
noname0815 wrote:
The problem is that each time the WAN IP address changes the rule becomes invalid (sometimes even deleted automatically).
So I need to renew it each time if the WAN IP changes.


when you get a new address does the interface go down/up again?
then you could use a .up script.
phuzi0n
DD-WRT Guru


Joined: 10 Oct 2006
Posts: 10141

PostPosted: Wed Apr 25, 2012 22:12    Post subject: Reply with quote
noname0815 wrote:
The problem is that each time the WAN IP address changes the rule becomes invalid (sometimes even deleted automatically).
So I need to renew it each time if the WAN IP changes.

Having the command deleted strongly suggests you saved it to the wrong script. Are you sure you saved it to the firewall script and not the startup script?

Any time your WAN IP changes should cause your WAN interface to be brought down and back up with the firewall be completely rebuilt and the firewall script being executed again with the new WAN IP.

_________________
Read the forum announcements thoroughly! Be cautious if you're inexperienced.
Available for paid consulting. (Don't PM about complicated setups otherwise)
Looking for bricks and spare routers to expand my collection. (not interested in G spec models)
Display posts from previous:    Page 1 of 1
Post new topic   Reply to topic    DD-WRT Forum Index -> Advanced Networking All times are GMT

Navigation

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You cannot download files in this forum