Hello Amin I will try to help you achieve what you want:
I understand you got 2 interfaces 18.104.22.168 and 22.214.171.124 and you need 126.96.36.199 to be public and 188.8.131.52 to be private with a Whitelist of IP's.
Follow this steps and I think you will be able to do it:
- Open you sshd_config file (use nano if you're a vi noob)
sudo vi /etc/ssh/sshd_config
- Add the following lines to the config file
Save and close the file
Restart the sshd daemon
sudo /etc/init.d/sshd restart OR sudo service sshd restart
- Check that SSH is listening to the ports you just defined
netstat -tulpn | grep :22
- Use Ubuntu's default Uncomplicated firewall to deny all traffic to your 184.108.40.206 interface
sudo ufw deny from any to 220.127.116.11 port 22
- Whitelist your IP and the ones you want to be able to access 18.104.22.168
sudo ufw allow in from 22.214.171.124 to 126.96.36.199 port 22
I think this is what you wanted, have a nice day!