Redirect for port 514 lost on reboot?

I have a udp listener configured for my ASA firewall, logging, parsing everything else is working great until you reboot, then the iptables entry and port redirect from 514 to 1514 appears to be lost?

Although I’m using the OVA image I’ve seen numerous examples of people performing the change in this way, and it works, the settings are just lost on reboot? Been ages since i’ve played around with iptables so I assume its something stupid I’ve missed or is this unique to the OVA?

ss -nplux|grep 514
sudo iptables -t nat -A PREROUTING -p udp -m udp --dport 514 -j REDIRECT --to-ports 1514
iptables -t nat -nL

Firewall rules added with the iptables command are not retained through a reboot.

Depending on your distribution, there are various ways of ensuring they survive a reboot. In RHEL6 and before, you simply made a boot-script that included all the desired rules. In RHEL7 you use firewall-cmd --permanent. In other Linux: I don’t know, but there’s always Google :wink:

Thanks, sorted it, have used the following, after adding the initial rule.

apt-get install iptables-persistent
/etc/init.d/iptables-persistent save
/etc/init.d/iptables-persistent reload

They now persist after reboots.

1 Like

Hey, good job! Nice start to the weekend, now that you’ve ticked another box.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.