pborawski

Technologie

Mar 30th, 2012
87
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.35 KB | None | 0 0
  1. 1. Polecenie:
  2. 1)iptables -t filter -L -v
  3. Chain INPUT (policy ACCEPT 40 packets, 5258 bytes)
  4. pkts bytes target prot opt in out source destination
  5.  
  6. Chain FORWARD (policy ACCEPT 0 packets, 0 bytes)
  7. pkts bytes target prot opt in out source destination
  8.  
  9. Chain OUTPUT (policy ACCEPT 43 packets, 2874 bytes)
  10. pkts bytes target prot opt in out source destination
  11. 2)iptables -t nat -L -v
  12. Chain PREROUTING (policy ACCEPT 0 packets, 0 bytes)
  13. pkts bytes target prot opt in out source destination
  14.  
  15. Chain INPUT (policy ACCEPT 0 packets, 0 bytes)
  16. pkts bytes target prot opt in out source destination
  17.  
  18. Chain OUTPUT (policy ACCEPT 0 packets, 0 bytes)
  19. pkts bytes target prot opt in out source destination
  20.  
  21. Chain POSTROUTING (policy ACCEPT 0 packets, 0 bytes)
  22. pkts bytes target prot opt in out source destination
  23. 3)iptables -t mangle -L -v
  24. Chain PREROUTING (policy ACCEPT 0 packets, 0 bytes)
  25. pkts bytes target prot opt in out source destination
  26.  
  27. Chain INPUT (policy ACCEPT 0 packets, 0 bytes)
  28. pkts bytes target prot opt in out source destination
  29.  
  30. Chain FORWARD (policy ACCEPT 0 packets, 0 bytes)
  31. pkts bytes target prot opt in out source destination
  32.  
  33. Chain OUTPUT (policy ACCEPT 0 packets, 0 bytes)
  34. pkts bytes target prot opt in out source destination
  35.  
  36. Chain POSTROUTING (policy ACCEPT 0 packets, 0 bytes)
  37. pkts bytes target prot opt in out source destination
  38. 4)iptables -t raw -L -v
  39. Chain PREROUTING (policy ACCEPT 0 packets, 0 bytes)
  40. pkts bytes target prot opt in out source destination
  41.  
  42. Chain OUTPUT (policy ACCEPT 0 packets, 0 bytes)
  43. pkts bytes target prot opt in out source destination
  44. 5) iptables -t security -L -v
  45. Chain INPUT (policy ACCEPT 0 packets, 0 bytes)
  46. pkts bytes target prot opt in out source destination
  47.  
  48. Chain FORWARD (policy ACCEPT 0 packets, 0 bytes)
  49. pkts bytes target prot opt in out source destination
  50.  
  51. Chain OUTPUT (policy ACCEPT 0 packets, 0 bytes)
  52. pkts bytes target prot opt in out source destination
  53.  
  54. 2. Pokolei:
  55. 1) iptables -t filter -F
  56. 2) iptables -t nat -F
  57. 3) iptables -t mangle -F
  58. 4) iptables -t raw -F
  59. 5) iptables -t security -F
  60. 3. iptables -A INPUT -i eth0 -j DROP
  61. iptables -A INPUT -i lo -j ACCEPT
  62. 4. iptables -R 2 INPUT -i lo -j DROP
  63. 5. iptables -F INPUT
  64. 6. Plik firewall.sh
  65.  
  66. #!/bin/bash
  67.  
  68. echo 'Ad a'
  69. iptables -F
  70. iptables -X
  71. echo 'Ad b.'
  72. iptables -P INPUT DROP
  73. iptables -P FORWARD DROP
  74. iptables -P OUTPUT ACCEPT
  75. iptables -A INPUT -m state --state RELATED,ESTABLISHED -j ACCEPT
  76. iptables -A OUTPUT -m state --state RELATED,ESTABLISHED -j ACCEPT
  77.  
  78. echo 'Ad. c'
  79. iptables -A INPUT -i lo -j ACCEPT
  80. echo 'Ad d.'
  81.  
  82. echo 'Ad e.'
  83. iptables -A INPUT -s ii.uwb.edu.pl -j DROP
  84. iptables -A OUTPUT -d ii.uwb.edu.pl -j DROP
  85. echo 'Ad.f'
  86. iptables -A FORWARD -d 192.168.1.253 -m multiport -p tcp --dports 23,22,80,110,443,8080 -j ACCEPT
  87.  
  88. 7. iptables -t filter -F
Advertisement
Add Comment
Please, Sign In to add comment