CS FundamentalsVery hardGATE CS · Product company CS fundamentals

A firewall applies the first matching rule: 1. deny tcp from any to 10.0.0.0/8 port 23 2. permit tcp from 192.168.1.0/24 to any port 22–23 3. deny ip from 192.168.1.128/25 to any 4. permit ip from any to any What happens to (a) TCP 192.168.1.200 → 10.1.1.1:23, (b) TCP 192.168.1.200 → 172.16.0.1:23, (c) UDP 192.168.1.130 → 8.8.8.8:53?

  1. A. deny, permit, deny
  2. B. deny, deny, deny
  3. C. deny, permit, permit
  4. D. permit, permit, deny

Correct answer: A. deny, permit, deny

(a) matches rule 1 first: deny. (b) is not to 10/8, so rule 2 permits it before rule 3 (which would deny its source) is reached. (c) is UDP, so rules 1–2 do not apply and rule 3 denies it. Order matters more than specificity.

More Computer Networks questions

Exams that ask this topic