Advertisement
Guest User

hmmpff...

a guest
Nov 24th, 2014
239
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 2.18 KB | None | 0 0
  1. #! /bin/bash
  2. #question 1.1.2
  3. iptables  -F
  4.  
  5. #question 1.1.3
  6. iptables -t filter -P INPUT DROP
  7. iptables -t filter -P OUTPUT DROP
  8. iptables -t filter -P FORWARD DROP
  9. #question 1.1.4
  10. iptables -t filter -A FORWARD --in-interface eth0 --protocol ICMP --jump REJECT
  11. iptables -t filter -A FORWARD --in-interface eth1 --protocol ICMP --jump REJECT
  12. #question 1.1.5
  13. iptables -t filter -A INPUT --jump LOG --log-prefix local
  14. iptables -t filter -A FORWARD --jump LOG --log-prefix routage
  15. #question 1.2.1
  16. iptables -t filter -A OUTPUT --protocol udp --destination-port 53 --jump ACCEPT
  17. iptables -t filter -A INPUT  --protocol udp --destination-port 53 --jump ACCEPT
  18. #question 1.2.2
  19. iptables -t filter -A OUTPUT --protocol udp --destination-port 80 --jump ACCEPT
  20. iptables -t filter -A INPUT  --protocol udp --destination-port 80 --jump ACCEPT
  21. #question 1.3.1
  22. iptables -t filter -A FORWARD --protocol udp --destination-port 53 --source 192.168.1.1/24 --jump ACCEPT
  23. iptables -t filter -A FORWARD  --protocol udp --source-port 53 --destination 192.168.1.1/24 --jump ACCEPT
  24. #question 1.3.2
  25. iptables -t filter -A FORWARD --protocol tcp --destination-port 80 --source 192.168.1.1/24 --jump ACCEPT
  26. iptables -t filter -A FORWARD --protocol tcp --source-port 80 --destination 192.168.1.1/24 --jump ACCEPT
  27. #question 1.4.1
  28. iptables -t filter -A FORWARD --protocol udp --destination-port 53 --source 172.18.1.1/24 --jump ACCEPT
  29. iptables -t filter -A FORWARD  --protocol udp --source-port 53 --destination 172.18.1.1/24 --jump ACCEPT
  30. #question 1.4.4
  31. iptables -t filter -A FORWARD --protocol udp --destination-port 53 --in-interface eth0 --jump ACCEPT
  32. iptables -t filter -A FORWARD  --protocol udp --source-port 53 --in-interface eth0 --jump ACCEPT
  33. #question 1.4.6
  34. iptables -t filter -A FORWARD --protocol tcp --destination-port 80 --source 172.18.1.1/24 --jump ACCEPT
  35. iptables -t filter -A FORWARD --protocol tcp --source-port 80 --destination 172.18.1.1/24 --jump ACCEPT
  36. #question 1.4.7
  37. #ne fonctionne pas mort de rire
  38. iptables -t filter -A FORWARD --protocol tcp --destination-port 16385 --in-interface eth0 --jump ACCEPT
  39. iptables -t filter -A FORWARD --protocol tcp --source-port 16385 --in-interface eth0 --jump ACCEPT
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement