Diferència entre revisions de la pàgina «Solució ufw»

De wikiserver
Dreceres ràpides: navegació, cerca
(Solució Exercici UFW)
(Solució Exercici UFW)
Línia 14: Línia 14:
  
 
# ok icmp codes
 
# ok icmp codes
-A ufw-before-input -p icmp --icmp-type destination-unreachable -j ACCEPT
+
#-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 source-quench -j ACCEPT
-A ufw-before-input -p icmp --icmp-type time-exceeded -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 parameter-problem -j ACCEPT
-A ufw-before-input -p icmp --icmp-type echo-request -j ACCEPT
+
#-A ufw-before-input -p icmp --icmp-type echo-request -j ACCEPT
  
 
or change the "ACCEPT" to "DROP" .
 
or change the "ACCEPT" to "DROP" .
  
# ok icmp codes
 
-A ufw-before-input -p icmp --icmp-type destination-unreachable -j DROP
 
-A ufw-before-input -p icmp --icmp-type source-quench -j DROP
 
-A ufw-before-input -p icmp --icmp-type time-exceeded -j DROP
 
-A ufw-before-input -p icmp --icmp-type parameter-problem -j DROP
 
-A ufw-before-input -p icmp --icmp-type echo-request -j DROP
 
  
 
hay que reiniciar el servicio para que el cambio tenga efecto.
 
hay que reiniciar el servicio para que el cambio tenga efecto.

Revisió del 10:35, 30 març 2016

Solució Exercici UFW

1. sudo ufw enable
2. sudo ufw status verbose
3. sudo ufw allow 22
4. sudo ufw delete allow 22
5. sudo ufw allow form IP to any port 22
6. sudo ufw allow 80
7.1 sudo ufw deny 80
7.2 sudo ufw allow from 172.16.204.0/24 to any port 80
8. sudo ufw logging on / sudo ufw logging off
9.
/etc/ufw/before.rules and remove the following lines:

# 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

or change the "ACCEPT" to "DROP" .


hay que reiniciar el servicio para que el cambio tenga efecto.
sudo service ufw restart

10. sudo ufw deny from 172.16.204.0/24
11. sudo ufw deny from 172.16.204.254 to any port 80
12. sudo ufw status numbered
13. sudo ufw delete 1