Advertisement
Guest User

Untitled

a guest
Jul 25th, 2016
52
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.22 KB | None | 0 0
  1. ssh -p 2222 192.168.2.100
  2. user@192.168.2.100's password:
  3.  
  4. sudo iptables -t nat -A PREROUTING -p tcp --dport 2222 -j DNAT --to-destination 192.168.2.100:2222
  5.  
  6. >sudo iptables -t raw -L
  7. Chain PREROUTING (policy ACCEPT)
  8. target prot opt source destination
  9.  
  10. Chain OUTPUT (policy ACCEPT)
  11. target prot opt source destination
  12.  
  13. >sudo iptables -t nat -L
  14. Chain PREROUTING (policy ACCEPT)
  15. target prot opt source destination
  16. DNAT tcp -- anywhere anywhere tcp dpt:2221 to:192.168.2.100:2222
  17.  
  18. Chain INPUT (policy ACCEPT)
  19. target prot opt source destination
  20.  
  21. Chain OUTPUT (policy ACCEPT)
  22. target prot opt source destination
  23.  
  24. Chain POSTROUTING (policy ACCEPT)
  25. target prot opt source destination
  26.  
  27. >sudo iptables -L
  28. Chain INPUT (policy ACCEPT)
  29. target prot opt source destination
  30.  
  31. Chain FORWARD (policy ACCEPT)
  32. target prot opt source destination
  33.  
  34. Chain OUTPUT (policy ACCEPT)
  35. target prot opt source destination
  36.  
  37. >ssh -p 2221 127.0.0.1
  38. ssh: connect to host 127.0.0.1 port 2221: Connection refused
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement