Saving an IP Forward in iptables

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


Joined: 05 Jul 2015
Posts: 1

PostPosted: Sun Jul 05, 2015 17:06    Post subject: Saving an IP Forward in iptables Reply with quote
Hi there,

A little disclaimer, I am not versed at all with Linux, IPTables or DD-WRT Networking in general. But I have been teaching myself as I go but it looks like I've hit a wall and need some help.

I want to forward any incoming or outgoing requests to/from IP (111.111.111.111) to go through IP (222.222.222.222) instead.

I can add the rule by using:

Code:

iptables -t nat -A PREROUTING -d 111.111.111.111 -j DNAT --to-destination 222.222.222.222


And when I run

Code:

iptables -t nat -L -n -v


I can see it:

Code:

    0     0 DNAT       0    --  *      *       0.0.0.0/0            111.111.111.111      to:222.222.222.222



However, when I try to access that IP from another client in the network, and then go to my Active Connections window, I see that the traffic is still going to 111.111.111.111.

How do I save this rule to iptables so that when I reboot the router it is there?

I guess my other question is, are these changes instant? And is my rule being trumped by anything else?

I am doing all of this via the Command window in the Admin section on the Web Interface. My attempts of using SSH have not netted in any success partially due to my limited knowledge in private/public keys.

Any help/guidance I can get here is greatly appreciated.

Andy.
Sponsor
netguru76
DD-WRT User


Joined: 14 Sep 2014
Posts: 52

PostPosted: Mon Jul 06, 2015 8:22    Post subject: Reply with quote
you have to reboot to get this rules finally activated.
put this iptable under administration tab an then save it to the "Firewall" ... reboot ...
Display posts from previous:    Page 1 of 1
Post new topic   Reply to topic    DD-WRT Forum 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