How To Install Iptables On Ubuntu?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
1. Update your package list:
`sudo apt update`
2. Install Iptables:
`sudo apt install iptables`
3. Configure your firewall rules:
`sudo iptables -A INPUT -s [IP-address] -j ACCEPT`
4. Save your firewall rules:
`sudo iptables-save > /etc/iptables.up.rules`
5. Configure your system to load the firewall rules on boot:
`sudo nano /etc/network/if-pre-up.d/iptables`
6. Add the following contents to the file and save it:
`#!/bin/sh
/sbin/iptables-restore < /etc/iptables.up.rules`
7. Change the permissions of the file:
`sudo chmod +x /etc/network/if-pre-up.d/iptables`
8. Reboot your system:
`sudo reboot`