Advertisement
Guest User

Untitled

a guest
Jun 26th, 2019
81
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.98 KB | None | 0 0
  1. Redes de Datos
  2.  
  3. [server]
  4. |
  5. (r2)
  6. |
  7. ^
  8. [pc1]--<(r1)>--<(firewall)>--[serverlocal]
  9.  
  10. Configuración de red
  11. pc1: ifconfig eth0 10.0.1.2/24
  12. pc1: route add default gw 10.0.1.1
  13. firewall: route add -net 10.0.1.0/24 gw 10.0.2.1
  14. serverlocal: ifconfig eth0 10.0.3.2/24
  15. serverlocal: route add default gw 10.0.3.1
  16.  
  17. Verificación
  18. serverlocal: netstat -tuplen
  19.  
  20. Conectar pc1 a serverlocal via links
  21. pc1: links http://serverlocal:8080
  22.  
  23. Politicas por defecto
  24. firewall: iptables -P INPUT ACCEPT
  25. firewall: iptables -P FORWARD ACCEPT
  26. firewall: iptables -P OUTPUT ACCEPT
  27. r1: iptables -P INPUT ACCEPT
  28. r1: iptables -P FORWARD ACCEPT
  29. r1: iptables -P OUTPUT ACCEPT
  30.  
  31. Denegar ping
  32. firewall: iptables -A FORWARD -p icmp --icmp-type echo-request -d 10.0.1.0/24 -j DROP
  33. firewall: iptables -A FORWARD -p icmp --icmp-type echo-request -d 10.0.3.0/24 -j DROP
  34.  
  35. Salida a internet
  36. firewall: iptables -t nat -A POSTROUTING -s 10.0.1.0/24 -o eth1 -j SNAT --to 200.200.0.2
  37. firewall: iptables -t nat -A POSTROUTING -s 10.0.3.0/24 -o eth1 -j SNAT --to 200.200.0.2
  38.  
  39. Acceso a serverlocal y pc1
  40. firewall: iptables -t nat -A PREROUTING -p tcp -d 200.200.0.2 --dport 80 -j DNAT --to 10.0.1.2:80
  41. firewall: iptables -t nat -A POSTROUTING -p tcp -s 10.0.1.2 --sport 80 -j SNAT --to 200.200.0.2:80
  42. firewall: iptables -t nat -A PREROUTING -p tcp -d 200.200.0.2 --dport 8080 -j DNAT --to 10.0.3.2:8080
  43. firewall: iptables -t nat -A POSTROUTING -p tcp -s 10.0.3.2 --sport 8080 -j SNAT --to 200.200.0.2:8080
  44. Ssh server a pc1
  45. firewall: iptables -I PREROUTING -t nat -p tcp -d 200.200.0.2 --dport 22 -j DNAT --to 10.0.1.2:22
  46. firewall: iptables -I POSTROUTING -t nat -p tcp -s 10.0.1.2 --sport 22 -j SNAT --to 200.200.0.2:22
  47.  
  48. Deniega login de DMZ a pc1
  49. firewall: iptables -I FORWARD -p tcp -s 10.0.3.0/24 --dport 22 -d 10.0.1.2 -j DROP
  50.  
  51. Deniega ping a server
  52. firewall: iptables -A FORWARD -p icmp --icmp-type echo-request -d 200.200.1.2 -j DROP
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement