I'm trying to configure ufw to only allow connections to 3 ip addresses on my local network, and deny everything else. Here's the commands I'm using:
yes | sudo ufw reset
sudo ufw default deny
sudo ufw allow in from 192.168.11.109
sudo ufw allow in from 192.168.11.118
sudo ufw allow in from 192.168.11.212
sudo ufw allow out to 192.168.11.109
sudo ufw allow out to 192.168.11.118
sudo ufw allow out to 192.168.11.212
sudo ufw enable
sudo ufw status verbose
Everything seems to work. Here's the result of the status command:
joel@walker11 ~> sudo ufw status verbose
Status: active
Logging: on (low)
Default: deny (incoming), deny (outgoing), disabled (routed)
New profiles: skip
To Action From
-- ------ ----
Anywhere ALLOW IN 192.168.11.109
Anywhere ALLOW IN 192.168.11.118
Anywhere ALLOW IN 192.168.11.212
192.168.11.109 ALLOW OUT Anywhere
192.168.11.118 ALLOW OUT Anywhere
192.168.11.212 ALLOW OUT Anywhere
However, I cannot ping any of those ip addresses that I explicitly allowed:
joel@walker11 ~> ping 192.168.11.109
PING 192.168.11.109 (192.168.11.109) 56(84) bytes of data.
ping: sendmsg: Operation not permitted
ping: sendmsg: Operation not permitted
^C
--- 192.168.11.109 ping statistics ---
2 packets transmitted, 0 received, 100% packet loss, time 1007ms
How can I setup my firewall to allow traffic to/from those ip addresses?
sudo ping
isn't any different. And yes, the router uses NAT.