• iptables syntax issue

    From Mike Scott@21:1/5 to All on Tue Nov 26 13:32:42 2024
    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

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Marc Haber@21:1/5 to Mike Scott on Tue Nov 26 21:24:40 2024
    Mike Scott <[email protected]d> wrote:
    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?

    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

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Mike Scott@21:1/5 to Marc Haber on Thu Nov 28 08:03:11 2024
    On 26/11/2024 20:24, Marc Haber wrote:
    Mike Scott <[email protected]d> wrote:
    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?

    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

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)