seems it works with -d instead --dport, human error :)
but what about the invert (!) option?
Code:
-p, --protocol [!] protocol
The protocol of the rule or of the packet to check. The speci-
fied protocol can be one of tcp, udp, icmp, or all, or it can be
a numeric value, representing one of these protocols or a dif-
ferent one. A protocol name from /etc/protocols is also
allowed. A "!" argument before the protocol inverts the test.
The number zero is equivalent to all. Protocol all will match
with all protocols and is taken as default when this option is
omitted.
Does any of this work for you?
root@tux lappen # iptables -A INPUT -p !tcp --dport 51000 -j ACCEPT
bash: !tcp: event not found
root@tux lappen # iptables -A INPUT -p ! tcp --dport 51000 -j ACCEPT
iptables: Invalid argument
EDIT: seems the ! invert option works with -d but not --dport, should it work with --dport?
iptables -A INPUT -p ! tcp -d 192.168.0.3 -j ACCEPT
ACCEPT !tcp -- anywhere 192.168.0.3
I would want a source or destiantion port with that but it seems it doesnt work that way
iptables -A INPUT -p ! tcp -d 192.168.0.3 --dport 50000 -j ACCEPT
iptables: Invalid argument
Maybe I am still missunderstanding everything