Q: Ubuntu Allow Specific IP to a PORT I have a service running in ubuntu 18.04 machine at a port 8080, I want specific IP should be able to access this service and other should get blocked.
How i can configure my machine to whitelist a specific IP to a port ?

A: Since your question is too generic for a specific answer I'll list your options:

*

*Solve it natively in your application.
Many services can be configured to maintain their own brand of IP based access control. Maybe your nameless service can also be configured with such an ACL.

Note that maintaining access controls in your application is often convenient but not the most secure, as unauthorized users need to be able to connect to the application before they can be identified and rejected.

*

*External  to the application you can configure a firewall to do such IP filtering:

*

*Many (hosting/vps) providers offer a firewall service or security groups that you can configure to block/allow specific or all traffic to a specific port on your system. Check with your provider for options.


*You can configure a host based firewall. See for example : https://ubuntu.com/server/docs/security-firewall
