Advertisement
Guest User

Untitled

a guest
Apr 20th, 2012
55
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.75 KB | None | 0 0
  1. root@cloud-prod04:~# iptables -F
  2. root@cloud-prod04:~# iptables -X
  3. root@cloud-prod04:~# iptables -t nat -F
  4. root@cloud-prod04:~# iptables -t nat -X
  5. root@cloud-prod04:~# iptables -t mangle -F
  6. root@cloud-prod04:~# iptables -t mangle -X
  7. root@cloud-prod04:~# iptables -P INPUT ACCEPT
  8. root@cloud-prod04:~# iptables -P FORWARD ACCEPT
  9. root@cloud-prod04:~# iptables -P OUTPUT ACCEPT
  10. root@cloud-prod04:~#
  11. root@cloud-prod04:~#
  12. root@cloud-prod04:~#
  13. root@cloud-prod04:~# iptables -I INPUT -p tcp --dport 80 -j ACCEPT
  14. root@cloud-prod04:~# iptables -t nat -A PREROUTING -d 169.254.169.254/32 -p tcp -m tcp --dport 80 -j DNAT --to-destination 10.1.8.11:8775
  15. root@cloud-prod04:~# telnet 169.254.169.254 80
  16. Trying 169.254.169.254...
  17. telnet: Unable to connect to remote host: Connection refused
  18. root@cloud-prod04:~# iptables -L -t nat
  19. Chain PREROUTING (policy ACCEPT)
  20. target prot opt source destination
  21. DNAT tcp -- anywhere 169.254.169.254 tcp dpt:http to:10.1.8.11:8775
  22.  
  23. Chain INPUT (policy ACCEPT)
  24. target prot opt source destination
  25.  
  26. Chain OUTPUT (policy ACCEPT)
  27. target prot opt source destination
  28.  
  29. Chain POSTROUTING (policy ACCEPT)
  30. target prot opt source destination
  31. root@cloud-prod04:~# telnet 10.1.8.11 8775
  32. Trying 10.1.8.11...
  33. Connected to 10.1.8.11.
  34. Escape character is '^]'.
  35. quit
  36. ^]quit
  37.  
  38. telnet> quit
  39. Connection closed.
  40. root@cloud-prod04:~# ^C
  41. root@cloud-prod04:~# iptables -L
  42. Chain INPUT (policy ACCEPT)
  43. target prot opt source destination
  44. ACCEPT tcp -- anywhere anywhere tcp dpt:http
  45.  
  46. Chain FORWARD (policy ACCEPT)
  47. target prot opt source destination
  48.  
  49. Chain OUTPUT (policy ACCEPT)
  50. target prot opt source destination
  51. root@cloud-prod04:~# iptables -L -n
  52. Chain INPUT (policy ACCEPT)
  53. target prot opt source destination
  54. ACCEPT tcp -- 0.0.0.0/0 0.0.0.0/0 tcp dpt:80
  55.  
  56. Chain FORWARD (policy ACCEPT)
  57. target prot opt source destination
  58.  
  59. Chain OUTPUT (policy ACCEPT)
  60. target prot opt source destination
  61. root@cloud-prod04:~# iptables -L -t nat -n
  62. Chain PREROUTING (policy ACCEPT)
  63. target prot opt source destination
  64. DNAT tcp -- 0.0.0.0/0 169.254.169.254 tcp dpt:80 to:10.1.8.11:8775
  65.  
  66. Chain INPUT (policy ACCEPT)
  67. target prot opt source destination
  68.  
  69. Chain OUTPUT (policy ACCEPT)
  70. target prot opt source destination
  71.  
  72. Chain POSTROUTING (policy ACCEPT)
  73. target prot opt source destination
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement