Differences

Compared

DROP vs REJECT

DROP throws the packet away and says nothing, so the client waits until it times out. REJECT throws it away and answers at once, with an ICMP error or a TCP reset, so the client fails immediately with connection refused.

Side by side

DROPREJECT
The sender gets NothingICMP port unreachable by default; a TCP reset with --reject-with tcp-reset
The client sees Connection timed out, after waitingConnection refused, at once
nmap reports filteredclosed when the answer is a TCP reset; filtered when it is an ICMP error
Gives away Little: silence only hints at a firewallAn ICMP error carries the address of the device that sent it
For real users Every mistake costs a timeoutA mistake fails fast
iptables -j DROP-j REJECT, or -j REJECT --reject-with tcp-reset

Each one explained

Drop or reject
Two ways to refuse a packet: silence, or an explicit answer.
Firewall
Rules deciding, packet by packet, what may reach or cross a device.
TCP reset
A TCP packet that aborts a connection; the answer to a SYN for a port with no listener.
ICMP
The network's messages about packets: echo for ping, unreachable, time exceeded, too big.

See the difference on real machines

Each lab is a small network of real Linux machines in your browser.

Open Firewall rules: keep the street out and let the staff in

When it breaks

Sources

Learn it on real machines.

Every lab is a small network of real Linux machines in your browser. Sign in with Google or email to start.

Start this lab