iptables
(and/or the successor tool nftables
) is the user-space utility program that allows a system administrator to configure the IP packet filter rules of the Linux kernel firewall, which is implemented as different Netfilter modules. (summary from Wikipedia)
Since iptables
and nftables
are a user-space utility programs intended to be used by people, by system administrators, and people are not always completely comfortable with the underlying numbers, they accept human readable descriptions for IP-protocols (tcp, icmp, udp etc), IP-addresses (hostnames), and port numbers (service-names).
From a UI aspect using human readable names appears to be a good thing:
- as an administrator I'm probably not the only one that has a much better intuitive grasp of the meaning of:
iptables --protocol udp
compared to:iptables --protocol 17
and similar. - a hostname
gateway.example.net
often makes more sense than an IP-address such as192.0.2.1
- and on a web server allowing HTTP and HTTPS is more obvious than allowing TCP/80 resp. TCP/443.
Is that safe to do?
Or should you stay away from that?
What are the caveats?