Advertisement
Guest User

Untitled

a guest
Oct 22nd, 2018
77
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.15 KB | None | 0 0
  1. #!/bin/sh -e
  2.  
  3. ### BEGIN INIT INFO
  4. # Provides: firewall-stop
  5. # Required-Start: $network $remote_fs $syslog
  6. # Required-Stop: $network $remote_fs $syslog
  7. # Should-Start: network-manager
  8. # Should-Stop: network-manager
  9. # X-Start-Before: $x-display-manager gdm kdm xdm wdm ldm sdm nodm
  10. # X-Interactive: true
  11. # Default-Start: 2 3 4 5
  12. # Default-Stop: 0 1 6
  13. # Short-Description: Firewall service by Olivier
  14. # Description: This script will stop the firewall rules
  15. ### END INIT INFO
  16.  
  17.  
  18. echo -n "Stopping firewall.... "
  19.  
  20. PATH=/sbin:/bin:/usr/sbin:/usr/bin
  21.  
  22. ################################################################################
  23. # Ou trouver iptables
  24.  
  25. IPTABLES="/sbin/iptables"
  26.  
  27.  
  28. ################################################################################
  29. # 2. Module loading.
  30. ################################################################################
  31.  
  32. /sbin/depmod -a
  33.  
  34. /sbin/modprobe ip_tables
  35. /sbin/modprobe ip_conntrack
  36. /sbin/modprobe iptable_filter
  37. /sbin/modprobe iptable_mangle
  38. /sbin/modprobe iptable_nat
  39. /sbin/modprobe ipt_LOG
  40. /sbin/modprobe ipt_limit
  41. /sbin/modprobe ipt_state
  42.  
  43.  
  44. ################################################################################
  45. # 3. /proc set up.
  46. ################################################################################
  47.  
  48. echo "0" > /proc/sys/net/ipv4/ip_forward
  49. echo "1" > /proc/sys/net/ipv4/conf/all/rp_filter
  50.  
  51. #
  52. # on remet tout à zéro
  53. $IPTABLES --flush
  54. $IPTABLES --delete-chain
  55. $IPTABLES --table nat --flush
  56.  
  57.  
  58. ########################################################################
  59.  
  60. $IPTABLES -P INPUT ACCEPT
  61. $IPTABLES -P OUTPUT ACCEPT
  62. $IPTABLES -P FORWARD ACCEPT
  63.  
  64. #
  65.  
  66.  
  67. echo "....stopped"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement