Servers-for-Hackers / the-book

Servers for Hackers eBook Issues
63 stars 5 forks source link

netfilters-persistent instead of iptables-persistent #84

Closed fideloper closed 6 years ago

fideloper commented 6 years ago

Quote:

It's on page 49/367 on the pdf version, section titled 'Saving Firewall Rules'

It looks like this command 'sudo service iptables-persistent start' does not work because I get this error 'Failed to start iptables-persistent.service: Unit iptables-persistent.service not found'

After a google search, I came with this on stackoverflow: https://askubuntu.com/questions/941315/failed-to-start-iptables-persistent-service

According to the answer: iptables-persistent as been replaced by netfilter-persistent.

So I tried 'sudo service netfilter-persistent start', and this command seems to work. 
jalogut commented 5 years ago

Hi @fideloper

Just to mention here that you need both packages to make it work. netfilter-persistent does not do anything if iptables-persistent is not installed. So in page 30, the command should include both packages:

1 #Install packages
2 sudo apt install -y iptables-persistent netfilter-persistent
3
4 #Start the service
5 sudo service netfilter-persistent start

Reference: https://askubuntu.com/questions/911863/where-does-netfilter-persistent-save-the-iptables-rules