Discussion:
iptables syntax issue
(too old to reply)
Mike Scott
2024-11-26 13:32:42 UTC
Permalink
Hi all. I'm trying to get to grips with iptables, but I'm flummoxed by this:

iptables> sudo iptables --table nat -D PREROUTING -p tcp --source
\!192.168.0.0/24 --dport ssh -j REDIRECT --to-port 20022
iptables v1.8.7 (nf_tables): host/network `!192.168.0.0' not found
Try `iptables -h' or 'iptables --help' for more information.


So what is the syntax to make a rule match sources other than the given
please?


Thanks.
--
Mike Scott
Harlow, England
Mike Scott
2024-11-26 13:44:58 UTC
Permalink
Post by Mike Scott
iptables> sudo iptables --table nat -D PREROUTING -p tcp --source
\!192.168.0.0/24 --dport ssh -j REDIRECT --to-port 20022
iptables v1.8.7 (nf_tables): host/network `!192.168.0.0' not found
Try `iptables -h' or 'iptables --help' for more information.
So what is the syntax to make a rule match sources other than the given
please?
Thanks.
Grrr. The online man page (https://linux.die.net/man/8/iptables) I was
looking at is wrong. It should be ! -s <address> not -s !<address>

Not good.
--
Mike Scott
Harlow, England
candycanearter07
2024-11-30 06:20:07 UTC
Permalink
Post by Mike Scott
Post by Mike Scott
iptables> sudo iptables --table nat -D PREROUTING -p tcp --source
\!192.168.0.0/24 --dport ssh -j REDIRECT --to-port 20022
iptables v1.8.7 (nf_tables): host/network `!192.168.0.0' not found
Try `iptables -h' or 'iptables --help' for more information.
So what is the syntax to make a rule match sources other than the given
please?
Thanks.
Grrr. The online man page (https://linux.die.net/man/8/iptables) I was
looking at is wrong. It should be ! -s <address> not -s !<address>
Not good.
Try emailing the webmaster?
--
user <candycane> is generated from /dev/urandom
Mike Scott
2024-12-03 19:19:43 UTC
Permalink
Post by candycanearter07
Try emailing the webmaster?
Done, but as they don't give contact info on their pages I assume
they're not welcoming input.
--
Mike Scott
Harlow, England
Mike Scott
2024-12-09 11:50:03 UTC
Permalink
Post by Mike Scott
Post by candycanearter07
Try emailing the webmaster?
Done, but as they don't give contact info on their pages I assume
they're not welcoming input.
And the email to ***@... has just bounced (Operation timed out).
They really don't seem to want people to talk to them.
--
Mike Scott
Harlow, England
George Neuner
2024-12-10 01:24:54 UTC
Permalink
On Mon, 9 Dec 2024 11:50:03 +0000, Mike Scott
Post by Mike Scott
Post by Mike Scott
Post by candycanearter07
Try emailing the webmaster?
Done, but as they don't give contact info on their pages I assume
they're not welcoming input.
They really don't seem to want people to talk to them.
The maintainer's address is web at die dot net
It's right on the main page.

Marc Haber
2024-11-26 20:24:40 UTC
Permalink
Post by Mike Scott
iptables> sudo iptables --table nat -D PREROUTING -p tcp --source
\!192.168.0.0/24 --dport ssh -j REDIRECT --to-port 20022
iptables v1.8.7 (nf_tables): host/network `!192.168.0.0' not found
Try `iptables -h' or 'iptables --help' for more information.
So what is the syntax to make a rule match sources other than the given
please?
I haven't used iptables directly in ages. Did you try putting
whitespace between the ! and the network?

Greetings
Marc
--
----------------------------------------------------------------------------
Marc Haber | " Questions are the | Mailadresse im Header
Rhein-Neckar, DE | Beginning of Wisdom " |
Nordisch by Nature | Lt. Worf, TNG "Rightful Heir" | Fon: *49 6224 1600402
Mike Scott
2024-11-28 08:03:11 UTC
Permalink
Post by Marc Haber
Post by Mike Scott
iptables> sudo iptables --table nat -D PREROUTING -p tcp --source
\!192.168.0.0/24 --dport ssh -j REDIRECT --to-port 20022
iptables v1.8.7 (nf_tables): host/network `!192.168.0.0' not found
Try `iptables -h' or 'iptables --help' for more information.
So what is the syntax to make a rule match sources other than the given
please?
I haven't used iptables directly in ages. Did you try putting
whitespace between the ! and the network?
Greetings
Marc
Thanks for the reply.

I found the man page I looked at was wrong. The syntax is /not/
-s ! <address>, rather ! -s <address>.
--
Mike Scott
Harlow, England
Loading...