Advertisement
Guest User

Untitled

a guest
Apr 19th, 2012
396
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.65 KB | None | 0 0
  1. Hi Chris/Allan,
  2.  
  3. Would you mind explaining the best approach to moving services from one Linux machine to several machines.
  4.  
  5. I recently had to move services from a single machine that was hosting DNS, apache, MySQL, SMTP to 3 different machines - one for DNS, another for apache+MySQL and another for the SMTP relay.
  6.  
  7. The problem was that this machine only had 1 public IP address and over 100 users making use of all these services through this single address. So changing the IP addresses for any of these services wasn't an option.
  8.  
  9. What I had to do was move apache+MySQL to new machine B.
  10. Move SMTP to new machine C.
  11. And keep DNS on old machine A.
  12. Machine A, B and C are networked locally on a second interface, but only machine A has the public internet routable IP.
  13.  
  14. What is the best way to get machine A (192.168.0.1) to forward:
  15. - Incoming request on port 80+3306 to machine B (192.168.0.2)
  16. - Incoming request on port 25 to machine C (192.168.0.3)
  17.  
  18. This would allow users to query the single IP address, but transparently have their requests forwarded to the correct machine.
  19.  
  20. Can you point me in the right direction to the type of technology or application I can use to do this type of port forwarding?
  21. Can I do it without the overhead of setting up a NAT on machine A?
  22.  
  23. Thanks guys and keep up the good work on the show!
  24.  
  25. Regards
  26. Simon, Australia
  27.  
  28. PS:
  29. I know iptables can do this type of port forwarding within a single machine:
  30. iptables -t nat -A PREROUTING -i eth0 -p tcp --dport 3307 -j REDIRECT --to-port 3306 # Command to make MySQL listen on port 3307 as well as default 3306.
  31. but this command doesn't work between multiple interfaces/machines.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement