Question 330
A firewall should allow packets based solely on addresses and port fields, without remembering previous connections. Which model describes it?
- Stateless packet filtering
- Destination NAT (DNAT)
- SNAT on egress
- DNAT with destination-port rewrite
- Source NAT (SNAT)
Explanation
Correct Answer
A:Stateless filtering evaluates each packet against rules independently of flow history. Stateful policy uses connection-tracking context to recognize return traffic.
Incorrect Answers
B:DNAT rewrites the destination address or port before forwarding to the intended private service; the task involves evaluating packets without connection history, whereas this addresses another subsystem.
C:Egress SNAT changes the source information so replies can be routed back through the translating gateway; its scope differs from evaluating packets without connection history, so it cannot meet the stated requirement.
D:Destination NAT can change both destination address and service port as packets enter the gateway; that is not equivalent to evaluating packets without connection history.
E:SNAT rewrites packet source addresses for egress traffic and tracks return mappings; the administrator instead needs evaluating packets without connection history; this option serves a different purpose.
Question 331
Many private connections should share one public IP by using distinct translated source ports. Which technique enables this?
- net.ipv4.ip_forward=1
- SNAT on egress
- Port Address Translation (PAT)
- DNAT with destination-port rewrite
Explanation
Correct Answer
C:PAT multiplexes connections through one public address by adjusting transport ports as needed. Stateful mappings let returning packets reach the right internal flow.
Incorrect Answers
A:The kernel's IPv4 forwarding setting permits routing across interfaces when other policies allow it; it answers a neighboring question rather than sharing a public IP across concurrent outbound sessions.
B:Egress SNAT changes the source information so replies can be routed back through the translating gateway; that changes a different part of the system; the requested outcome is sharing a public IP across concurrent outbound sessions.
D:Destination NAT can change both destination address and service port as packets enter the gateway; it will not provide sharing a public IP across concurrent outbound sessions under these conditions.
Question 332
A Linux router must actually forward IPv4 packets between interfaces after firewall policy is set. Which sysctl controls that behavior?
- Port Address Translation (PAT)
- Destination NAT (DNAT)
- net.ipv4.ip_forward=1
- Stateless packet filtering
Explanation
Correct Answer
C:The kernel's IPv4 forwarding setting permits routing across interfaces when other policies allow it. A permissive firewall by itself does not enable forwarding.
Incorrect Answers
A:PAT multiplexes connections through one public address by adjusting transport ports as needed; the requirement is enabling kernel IPv4 packet forwarding, outside the effect of this choice.
B:DNAT rewrites the destination address or port before forwarding to the intended private service; it does not deliver enabling kernel IPv4 packet forwarding, which is decisive in this scenario.
D:Stateless filtering evaluates each packet against rules independently of flow history; the task involves enabling kernel IPv4 packet forwarding, whereas this addresses another subsystem.
Question 333
A packet-filter rule must match connection states and permit established return traffic. Which mechanism supplies state tracking?
- iptables -A INPUT ...
- ipset or nftables set
- ufw status numbered
- Conntrack state match
Explanation
Correct Answer
D:Netfilter connection tracking recognizes flows such as established and related traffic. This allows return packets without explicitly opening every ephemeral port.
Incorrect Answers
A:iptables manipulates the traditional chain/rule abstraction, possibly through an nft backend on modern distributions; that is not equivalent to distinguishing established traffic from new connections.
B:Address sets allow a rule to test membership in many IP values efficiently; the administrator instead needs distinguishing established traffic from new connections; this option serves a different purpose.
C:UFW can list configured rules with stable display numbers for the current listing; it answers a neighboring question rather than distinguishing established traffic from new connections.
Question 334
A public service uses TCP port 8443 externally but should reach an internal server on port 443. Which translation feature fits?
- Source NAT (SNAT)
- DNAT with destination-port rewrite
- Port Address Translation (PAT)
- net.ipv4.ip_forward=1
Explanation
Correct Answer
B:Destination NAT can change both destination address and service port as packets enter the gateway. Return connections rely on matching stateful translation.
Incorrect Answers
A:SNAT rewrites packet source addresses for egress traffic and tracks return mappings; it will not provide mapping an external port to a different internal port under these conditions.
C:PAT multiplexes connections through one public address by adjusting transport ports as needed; the requirement is mapping an external port to a different internal port, outside the effect of this choice.
D:The kernel's IPv4 forwarding setting permits routing across interfaces when other policies allow it; it does not deliver mapping an external port to a different internal port, which is decisive in this scenario.
Question 335
A firewalld change must allow the ssh service persistently AND be activated in the current running firewall. Which TWO commands complete both steps? Choose TWO.
- firewall-cmd --permanent --add-service=ssh
- Firewalld rich rule with source address
- firewall-cmd --reload
- firewall-cmd --zone=public --list-all
- firewall-cmd --get-active-zones
Explanation
Correct Answers
A:The permanent flag changes saved zone configuration rather than only the current runtime. A reload or corresponding runtime change is needed to activate it immediately.
C:firewall-cmd --reload makes firewalld apply saved permanent rules to the active runtime policy. In this question the SSH allowance must first be saved persistently, or a reload would not keep the intended change.
Incorrect Answers
B:Rich rules combine conditions such as source address and service with actions; its scope differs from persistently saving and activating an SSH firewall allowance, so it cannot meet the stated requirement.
D:The list-all view reports the chosen zone's ports, services, interfaces and sources; the administrator instead needs persistently saving and activating an SSH firewall allowance; this option serves a different purpose.
E:This command reports active zone names and attached sources or interfaces; it answers a neighboring question rather than persistently saving and activating an SSH firewall allowance.
Question 336
An administrator has a long list of source IPs to block and wants efficient set-based matching. Which feature fits?
- ufw status numbered
- nftables
- Conntrack state match
- ufw allow 443/tcp
- ipset or nftables set
Explanation
Correct Answer
E:Address sets allow a rule to test membership in many IP values efficiently. They avoid duplicating an entire rule for every address.
Incorrect Answers
A:UFW can list configured rules with stable display numbers for the current listing; that changes a different part of the system; the requested outcome is matching a firewall rule against an IP address set.
B:nftables is a modern Netfilter ruleset framework supporting tables, chains, sets and state matching; this does not achieve matching a firewall rule against an IP address set on the system described.
C:Netfilter connection tracking recognizes flows such as established and related traffic; it will not provide matching a firewall rule against an IP address set under these conditions.
D:UFW provides a simplified frontend to host firewall rules; using it would leave matching a firewall rule against an IP address set unresolved.
Question 337
Network operators need to inspect all effective port and service permissions in one selected zone. Which command displays them?
- firewall-cmd --zone=public --list-all
- Firewalld zones
- firewall-cmd --reload
- firewall-cmd --permanent --add-service=ssh
Explanation
Correct Answer
A:The list-all view reports the chosen zone's ports, services, interfaces and sources. It helps identify where a rule was actually applied.
Incorrect Answers
B:Zones associate interfaces or sources with collections of allowed services and ports; the evidence calls for listing a zone's runtime rules and associations, not merely this separate operation.
C:Reloading reapplies permanent firewalld configuration to the active ruleset; the task involves listing a zone's runtime rules and associations, whereas this addresses another subsystem.
D:The permanent flag changes saved zone configuration rather than only the current runtime; its scope differs from listing a zone's runtime rules and associations, so it cannot meet the stated requirement.
Question 338
Administrators want to determine the currently active zones and their associated interfaces. Which command displays them?
- firewall-cmd --get-active-zones
- firewall-cmd --zone=public --list-all
- Firewalld rich rule with source address
- firewall-cmd --reload
- firewall-cmd --add-service=https
- Firewalld zones
Explanation
Correct Answer
A:This command reports active zone names and attached sources or interfaces. It is diagnostic and does not modify the firewall.
Incorrect Answers
B:The list-all view reports the chosen zone's ports, services, interfaces and sources; it answers a neighboring question rather than inspecting active firewalld zone assignments.
C:Rich rules combine conditions such as source address and service with actions; that changes a different part of the system; the requested outcome is inspecting active firewalld zone assignments.
D:Reloading reapplies permanent firewalld configuration to the active ruleset; this does not achieve inspecting active firewalld zone assignments on the system described.
E:Adding a service uses firewalld's defined port/protocol mapping for that service; it will not provide inspecting active firewalld zone assignments under these conditions.
F:Zones associate interfaces or sources with collections of allowed services and ports; using it would leave inspecting active firewalld zone assignments unresolved.
Question 339
A rule should allow SSH only from one management subnet rather than every source. Which firewalld feature supports a source-conditional rule?
- Firewalld rich rule with source address
- firewall-cmd --add-service=https
- firewall-cmd --reload
- firewall-cmd --add-port=8443/tcp
Explanation
Correct Answer
A:Rich rules combine conditions such as source address and service with actions. They provide finer control than simply opening a zone-wide service.
Incorrect Answers
B:Adding a service uses firewalld's defined port/protocol mapping for that service; the requirement is restricting an allowed service to a source subnet, outside the effect of this choice.
C:Reloading reapplies permanent firewalld configuration to the active ruleset; it does not deliver restricting an allowed service to a source subnet, which is decisive in this scenario.
D:A runtime command modifies active rules without changing permanent configuration; the evidence calls for restricting an allowed service to a source subnet, not merely this separate operation.
Question 340
A Linux gateway runs a local transparent HTTP proxy on port 3128. Incoming TCP requests addressed to port 80 should be intercepted by that gateway itself, without a separate destination server address. Which nftables NAT statement fits?
- redirect to :3128
- masquerade
- snat to 198.51.100.10
- ct state established
- drop
Explanation
Correct Answer
A:The nftables redirect statement changes the destination to a local socket on the gateway. In an appropriate NAT chain matching TCP port 80, it can deliver traffic to the local proxy on port 3128.
Incorrect Answers
B:Masquerading changes the source address for outbound NAT traffic. It does not move inbound HTTP traffic to a different local listener port.
C:Static source NAT changes where a packet appears to originate. It leaves the requested local destination-port interception unimplemented.
D:Connection-state matching classifies an existing flow but does not perform destination translation. It cannot redirect new inbound requests to the local proxy.
E:A drop verdict silently discards matching packets. The request is to deliver HTTP requests to the proxy, not block them.