Advertisement
Guest User

Untitled

a guest
Dec 5th, 2019
82
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.39 KB | None | 0 0
  1. > W tabeli filter utwórz nowy łańcuch, który dodaj jako cel do łańcucha INPUT (z tabeli filter)
  2.  
  3. - sudo iptables -N myChain
  4. - sudo iptables -A INPUT -j myChain
  5. - sudo iptables -L
  6.  
  7.  
  8. W utworzonym łańcuchu dodaj reguły:
  9. > akceptowane były połączenia z lokalnej maszyny
  10. sudo iptables -A myChain -s 127.0.0.0/8 -j ACCEPT
  11.  
  12. > akceptowane były połączenia z zainstalowanymi usługami
  13. - sudo iptables -A myChain -p tcp --dport ssh -j ACCEPT
  14. - sudo iptables -A myChain -p tcp --dport http -j ACCEPT
  15. - sudo iptables -A myChain -p tcp --dport https -j ACCEPT
  16. - sudo iptables -A myChain -p tcp --dport 53 -j ACCEPT
  17. - sudo iptables -A myChain -p tcp --dport 25 -j ACCEPT
  18. - sudo iptables -L myChain
  19.  
  20. > pakiety ICMP przychodzące z komputera 158.75.112.120 były odrzucane z wysyłaniem informacji o niedostępności maszyny
  21. - sudo iptables -A myChain -s 158.75.112.120 -p icmp -j REJECT
  22.  
  23. sudo iptables -A myChain -s 10.0.2.5 -p icmp -j REJECT
  24.  
  25. > akceptowane były pozostałe pakiety ICMP z sieci 158.75.112.0/24, 158.75.12.0/24, 192.168.132.0/24 i 192.168.128.0/24
  26. - sudo iptables -A myChain -s 158.75.112.0/24 -p icmp -j ACCEPT
  27. - sudo iptables -A myChain -s 158.75.12.0/24 -p icmp -j ACCEPT
  28. - sudo iptables -A myChain -s 192.168.132.0/24 -p icmp -j ACCEPT
  29. - sudo iptables -A myChain -s 192.168.128.0/24 -p icmp -j ACCEPT
  30.  
  31. > odrzucane były pozostałe pakiety
  32. - sudo iptables -P INPUT DROP%
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement