I need to use UFW to allow only 3x different IP addresses to connect on a specific port.
Ex:
IP address [1] – 111.111.111.111
IP address [1] – 222.222.222.222
IP address [1] – 333.333.333.333
on a specific port. All other connections denied.
Any help please?
Can I simply add 3x rules one after each other for each ip address to point at the port?
Ubuntu – Ubuntu UFW 3x specific IP addresses only to access a specific port
firewall
Best Answer
First lets deny all access:
Now limit out inbound traffic to
ip
via theseports
:If adding a specific protocol to the rules above:
Now check your rules:
To delete these rules at any time:
Source:
https://help.ubuntu.com/community/UFW
https://www.digitalocean.com/community/tutorials/how-to-set-up-a-firewall-with-ufw-on-ubuntu-14-04