207k views
1 vote
From which of the following files does the iptables command read ports of well-known services?

a. /var/log/ports
b. /etc/services
c. /etc/fstab
d. /root/known_hosts

1 Answer

3 votes

The iptables command reads ports of well-known services from the file located at option b: / etc /services.

How to explain

This file contains a list of network services and their associated port numbers, which helps various networking tools and applications map service names to their respective port numbers.

When configuring firewall rules using iptables, referencing this file assists in specifying allowed or restricted network traffic by using service names instead of raw port numbers, enhancing ease of management and understanding in setting up firewall configurations.

User Reticulated Spline
by
8.3k points