What iptables chain would give me drop all request except those from the local subnet

so iptables -A INPUT -s 192.168.1.0/24 -j ACCEPT would accept
im looking for iptables -A INPUT ! -s 192.168.1.0/24 -j DROP equivalent ??

What Im not looking for is
DROP ALL Connections,
then
Accept localsubnet
(trivial)

thnx

This should do the task:

iptables -P INPUT DROP
iptables -A INPUT -s 192.168.1.0/24 -j ACCEPT

As a matter a fact this does first allow all the connections in the iptables rules and what is not allowed in the list is dropped.

What Im not looking for is
DROP ALL Connections,

then
Accept localsubnet

This is not possible. If you drop all connections after this you cannot allow localsubnet because it is already dropped.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.