/etc/hosts.allow with hosts.deny.
The priority is checked first, Check Hosts.Allow,
The latter settings can be limited by the former,
E.g:
1. Limit all Telnet,
Unless there is from 202.115.64.0 to 127.
Hosts.deny:
in.telnetd: all
Hosts.Allow:
In.Telnetd: 202.115.64.0/255.255.255.128
2. Telnet of 202.115.64.0--127
Hosts.deny
In.Telnetd: 202.115.64.0/255.255.255.128
3. Restrict all TCP connections unless from 202.115.64.0--127
Hosts.deny
All: ALL
Hosts.allow
All: 202.115.64.0/255.255.255.128
4. Limit 202.115.64.0--127 Access to all services
Hosts.deny
All: 202.115.64.0/255.255.255.128
Where the colon is the service process name of TCP DAEMON, usually the system
The process is specified in /etc/inetd.conf, such as in.ftpd, in.telnetd.
Among them, there are several in the IP address range, the main three are:
1. Network address - subnet mask mode:
202.112.1.0/255.255.255.0
2. Network address mode (I call it myself, huh, huh)
202.112. (Ie, the IP address headed at 202.112)
3. The thumbnail subnet mask method, how many "1" in front of the binary subnet mask, such as:
202.112.1.0/255.255.255.0"===="202.12.1.0/24