I want to allow all LAN traffic to my Ubuntu server. I have read the documentation and see the command, but when I try to edit the command for my IP range I get an error. How can I allow all traffic starting at -

sudo ufw allow from ERROR: Bad source address

It seems like the 15 (third octal) is causing the error. Almost like UFW does not expect a LAN to have a unique IP set.

Thank you

  • good question, but ufw is a simple interface above the iptables, you may able to do more control over packets via iptables. i prefer you to read this nice article about iptables: faqs.org/docs/iptables – pylover Jan 7 '13 at 23:50
  • 1
    @pylover This is not helpful for this question. UFW is useful to simplifiy iptable tasks and what he wants to do is possible with it. – Christopher Perrin Aug 5 '14 at 18:43
sudo ufw allow from
| improve this answer | |
  • Does 0/24 include IPs such as – Christopher Altman Oct 13 '09 at 16:16
  • 2
    Yes. includes adresses from to – Roy Oct 13 '09 at 16:41
  • 1
    What if i want to allow both (IN and OUT)? ufw allow out from to ? – 16851556 Mar 7 '18 at 12:22
  • 1
    For those wondering about the /24, see here. Essentially, the first 24 bits of the IP address (192.168.15) are fixed. – Mateen Ulhaq Jun 10 '19 at 9:55
  • I might be nitpicky, but is actually from to, totaling 256 IPs as 2^(32-24) – fa wildchild 21 hours ago

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.