Advertisement
Guest User

Untitled

a guest
Nov 27th, 2014
200
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.20 KB | None | 0 0
  1. ADD IPv4 Block In the Private IP Range
  2. (ie 192.168.0.0/24, 10.0.0.0/24)
  3.  
  4. nano /etc/modprobe.d/openvz.conf
  5. Change ip_conntrack ip_conntrack_disable_ve0=1 to ip_conntrack ip_conntrack_disable_ve0=0
  6.  
  7. CREATE NAT Access
  8. iptables -t nat -A POSTROUTING -o eth0 -j SNAT --to NODEIP
  9. Change Node IP to External IP Address
  10.  
  11.  
  12. SSH Port Forwarding (TCP & UDP)
  13. iptables -t nat -A PREROUTING -p tcp -d NODEIP --dport EXTERNALPORTNUMBER -i eth0 -j DNAT --to-destination *Internal IP*:22
  14. iptables -t nat -A PREROUTING -p udp -d NODEIP --dport EXTERNALPORTNUMBER -i eth0 -j DNAT --to-destination *Internal IP*:22
  15.  
  16. Change NODEIP to External IP address you want to use
  17. change EXTERNALPORTNUMBER to what port you want to forward for SSH
  18. change internal ip to the internal ip address assigned.
  19.  
  20. Forwarding Other Ports
  21.  
  22. iptables -t nat -A PREROUTING -p tcp -d NodeIP --dport startPort:endPort -j DNAT --to-destination *Internal IP*
  23.  
  24. Change NodeIP to external Address
  25. Change startPort to what port you wish to start with (ie, 201 - Do not Inlcude the SSH Port)
  26. Change endPort to the last port you want to forward
  27. change internal IP to the Internal IP address added.
  28.  
  29. Other then that. fairly simples... but trial and error.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement