If you want only the IP addresses you have specified to enter SSH in Centos 7, you can easily perform the process with the following 2 arrangements.
The first file to be edited is “/etc/hosts.allow”. Here we allow SSH connection from “10.1.2.3” ip.
sshd: 10.1.2.3
Now we are editing the “/etc/hosts.deny” file. Here we deny connection from anywhere.
sshd: All
You do not need to restart the system to complete the process.