I want to set myself up the rules for firewall in iptables. But several queries have delivered different file-locations for iptables-rules.

One location is in /usr/local/bin and there is to create file with name fwall-rules as script ?! - But this looks antique ...

Other location is to create file apparently in /etc with name of script iptables.rules ?! (as explained in: https://help.ubuntu.com/community/IptablesHowTo)

Where is today fwall-rules to be edited in 18.04 for iptables ?

Are the fwall-rules then included in iptables automatically - or do I need to create a link for this in terminal for Ubuntu ?

When I write as command:

sudo ip6tables -I INPUT -s fe80::b131:5a4d:9ebf:4c36 -j DROP

Where is this then saved ?

1 Answer 1


You don't really need to bother with file locations as long as you use either UFW or iptables commands to change the firewall rules.

Ubuntu now has UFW - Uncomplicated Firewall - that works as a wrapper for iptables and that makes it easier to enable the firewall and to edit rules. By default, the UFW is turned off and must be turned on with

sudo ufw enable

Rules are added with a simple allow or deny, for example:

sudo ufw allow <port>/<optional: protocol>

Both ports/packets and services can be allowed or denied. See the reference above for details on rules.

For more complex hardware setups - for instance several NICs on the same box - foregoing the simplicity of the UFW and editing iptables directly may be adviseable. This is set out in the How To you referred to: Iptables How To.

  • You mean command iptables and ip6tables is not used any more ? - But these commands are still active ? Oct 11, 2018 at 13:16
  • Yes, @dschinn1001, you can use either one or the other, but UFW is simpler and usually sufficient, unless you have a complex NIC setup.
    – ElToro1966
    Oct 11, 2018 at 18:33
  • ... the thing is, that some Adresses ignore my Commando as typed below in my question. Oct 11, 2018 at 19:00
  • address fe80::b131:5a4d:9ebf:4c36 is still active - how can I block this with success ?! ip6tables command is somehow ingnored ? ... Oct 12, 2018 at 19:12
  • What is the output of sudo ip6tables -S and sudo ip6tables -L ?
    – ElToro1966
    Oct 17, 2018 at 9:11

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .