24

I've seen people use the exclamation mark (!) in multiple examples, but when I try to use it I get an error.

The rule I'm trying:

-A OUTPUT -m owner --gid-owner 1006 -d ! 192.168.1.0/24 -j DROP

The error:

Bad argument '192.168.1.0/24'

What is the correct syntax for this?

user12932
  • 395

1 Answers1

44

Just as the manpage states:

[!] -d, --destination address[/mask][,...]
       Destination  specification.   See  the  description  of  the  -s
       (source)  flag  for  a  detailed description of the syntax.  The
       flag --dst is an alias for this option.

That makes it

! -d 192.168.1.0/24