How to make iptables persistent after a reboot and therafter

General discussion about Gargoyle, OpenWrt or anything else even remotely related to the project

Moderator: Moderators

Post Reply
khisanth
Posts: 3
Joined: Thu Apr 03, 2014 11:15 pm

How to make iptables persistent after a reboot and therafter

Post by khisanth »

Greetings,

I am trying to make those two iptables lines Persistent after a reboot

Code: Select all

iptables -t nat -A PREROUTING -d 8.8.8.8 -j DNAT --to-destination 107.20.195.51
iptables -t nat -A PREROUTING -d 8.8.4.4 -j DNAT --to-destination 107.20.190.171
So i added them to the Etc/rc.local file

Code: Select all

# Put your custom commands here that should be executed once
# the system init finished. By default this file does nothing.
iptables -t nat -A PREROUTING -d 8.8.8.8 -j DNAT --to-destination 107.20.195.51
iptables -t nat -A PREROUTING -d 8.8.4.4 -j DNAT --to-destination 107.20.190.171
exit 0
After rebooting, i check the status with "iptables -t nat -L PREROUTING -v" and the 2 lines are present in my iptable. All is good.

However, after some time....they disapear! Looks like there is a job in gargoyle rebuilding the iptables and clearing my custom lines....Any idea what's happening there?

I use this to watch netflix US on chromecast from canada. It works fine even after a reboot, then after some time netflix stops working, that's how i saw that the config was flushed after a while....

Post Reply