Φίλε ο οδηγός σου εχει λάθη
Οι επιλογές Αllow/Deny/Reject δεν έχουν να κάνουν με το ping αλλα με το πώς θα αντιδράσει το firewall όταν πάρει ένα πακέτο
Allow, θα το επιτρέψει
Deny, θα το απορρίψει σιωπηλά αυτό που δηλαδή λέμε stealth
Reject, θα το απορρίψει στέλνοντας ένα πακέτο οτι η πόρτα είναι closed
H συμπεριφορά για τα pings ορίζεται απο κάποιους κανόνες που βρίσκονται σε ένα chain που δε μπορούμε να ελέγξουμε με το GUFW και προηγούνται απο αυτούς που έχει δημιουργήσει ο χρήστης, οι κανόνες αυτοί βρίσκονται στο /etc/ufw/before.rules και μπορούν να γίνουν edit μονο με το χέρι. Tα pings είναι enabled by default οτι και να κάνεις στο GUFW λόγω before.rules.
- Κώδικας: Επιλογή όλων
sudo gedit /etc/ufw/before.rules
- Κώδικας: Επιλογή όλων
#
# rules.before
#
# Rules that should be run before the ufw command line added rules. Custom
# rules should be added to one of these chains:
# ufw-before-input
# ufw-before-output
# ufw-before-forward
#
# Don't delete these required lines, otherwise there will be errors
*filter
:ufw-before-input - [0:0]
:ufw-before-output - [0:0]
:ufw-before-forward - [0:0]
:ufw-not-local - [0:0]
# End required lines
# allow all on loopback
-A ufw-before-input -i lo -j ACCEPT
-A ufw-before-output -o lo -j ACCEPT
# quickly process packets for which we already have a connection
-A ufw-before-input -m state --state RELATED,ESTABLISHED -j ACCEPT
-A ufw-before-output -m state --state RELATED,ESTABLISHED -j ACCEPT
# drop INVALID packets (logs these in loglevel medium and higher)
-A ufw-before-input -m state --state INVALID -j ufw-logging-deny
-A ufw-before-input -m state --state INVALID -j DROP
# ok icmp codes
-A ufw-before-input -p icmp --icmp-type destination-unreachable -j ACCEPT
-A ufw-before-input -p icmp --icmp-type source-quench -j ACCEPT
-A ufw-before-input -p icmp --icmp-type time-exceeded -j ACCEPT
-A ufw-before-input -p icmp --icmp-type parameter-problem -j ACCEPT
-A ufw-before-input -p icmp --icmp-type echo-request -j ACCEPT
# allow dhcp client to work
-A ufw-before-input -p udp --sport 67 --dport 68 -j ACCEPT
#
# ufw-not-local
#
-A ufw-before-input -j ufw-not-local
# if LOCAL, RETURN
-A ufw-not-local -m addrtype --dst-type LOCAL -j RETURN
# if MULTICAST, RETURN
-A ufw-not-local -m addrtype --dst-type MULTICAST -j RETURN
# if BROADCAST, RETURN
-A ufw-not-local -m addrtype --dst-type BROADCAST -j RETURN
# all other non-local packets are dropped
-A ufw-not-local -m limit --limit 3/min --limit-burst 10 -j ufw-logging-deny
-A ufw-not-local -j DROP
# allow MULTICAST, be sure the MULTICAST line above is uncommented
-A ufw-before-input -s 224.0.0.0/4 -j ACCEPT
-A ufw-before-input -d 224.0.0.0/4 -j ACCEPT
# don't delete the 'COMMIT' line or these rules won't be processed
COMMIT
και αλλάζουμε σε drop ή reject ή κάνουμε comment.
Eπίσης υπάρχουν οι κανόνες /etc/ufw/before6.rules για IPv6, το /etc/ufw/sysctl.conf ή /etc/sysctl.conf με το οποίο ρυθμίζουμε παραπάνω παραμέτρους όπως τα redirects ή το kernel anti spoofing, όπως επίσης και το /etc/default/ufw.
To GUFW είναι πολύ βασικό εργαλείο και το μονο που μπορείς να κάνεις είναι να ανοίξεις κάποιες πόρτες, αν θες κάτι παραπάνω τότε μονο με ufw cli, pure iptables με το χέρι ή Firewall Builder.