Advertisement
Guest User

Untitled

a guest
Jan 25th, 2020
116
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.29 KB | None | 0 0
  1. sudo nano /etc/sysctl.conf
  2. Add or modify the following.
  3.  
  4. # IP Spoofing protection
  5. ​net.ipv4.conf.all.rp_filter = 1
  6. ​net.ipv4.conf.default.rp_filter = 1
  7. ​# Ignore ICMP broadcast requests
  8. ​net.ipv4.icmp_echo_ignore_broadcasts = 1
  9. ​# Disable source packet routing
  10. ​net.ipv4.conf.all.accept_source_route = 0
  11. ​net.ipv6.conf.all.accept_source_route = 0
  12. ​net.ipv4.conf.default.accept_source_route = 0
  13. ​net.ipv6.conf.default.accept_source_route = 0
  14. ​# Ignore send redirects
  15. ​net.ipv4.conf.all.send_redirects = 0
  16. ​net.ipv4.conf.default.send_redirects = 0
  17. ​# Block SYN attacks
  18. ​net.ipv4.tcp_syncookies = 1
  19. ​net.ipv4.tcp_max_syn_backlog = 2048
  20. ​net.ipv4.tcp_synack_retries = 2
  21. ​net.ipv4.tcp_syn_retries = 5
  22. ​# Log Martians
  23. ​net.ipv4.conf.all.log_martians = 1
  24. ​net.ipv4.icmp_ignore_bogus_error_responses = 1
  25. ​# Ignore ICMP redirects
  26. ​net.ipv4.conf.all.accept_redirects = 0
  27. ​net.ipv6.conf.all.accept_redirects = 0
  28. ​net.ipv4.conf.default.accept_redirects = 0
  29. ​net.ipv6.conf.default.accept_redirects = 0
  30. ​# Ignore Directed pings
  31. ​net.ipv4.icmp_echo_ignore_all = 1
  32.  
  33. # Accept Redirects? No, this is not router
  34. net.ipv4.conf.all.secure_redirects = 0
  35.  
  36. # Log packets with impossible addresses to kernel log? yes
  37. net.ipv4.conf.default.secure_redirects = 0
  38.  
  39. #Enable ExecShield protection
  40. kernel.exec-shield = 1
  41. kernel.randomize_va_space = 1
  42.  
  43. ########## IPv6 networking start ##############
  44. # Number of Router Solicitations to send until assuming no routers are present.
  45. # This is host and not router
  46. net.ipv6.conf.default.router_solicitations = 0
  47.  
  48. # Accept Router Preference in RA?
  49. net.ipv6.conf.default.accept_ra_rtr_pref = 0
  50.  
  51. # Learn Prefix Information in Router Advertisement
  52. net.ipv6.conf.default.accept_ra_pinfo = 0
  53.  
  54. # Setting controls whether the system will accept Hop Limit settings from a router advertisement
  55. net.ipv6.conf.default.accept_ra_defrtr = 0
  56.  
  57. #router advertisements can cause the system to assign a global unicast address to an interface
  58. net.ipv6.conf.default.autoconf = 0
  59.  
  60. #how many neighbor solicitations to send out per address?
  61. net.ipv6.conf.default.dad_transmits = 0
  62.  
  63. # How many global unicast IPv6 addresses can be assigned to each interface?
  64. net.ipv6.conf.default.max_addresses = 1
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement