Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Hi Chris/Allan,
- Would you mind explaining the best approach to moving services from one Linux machine to several machines.
- 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.
- 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.
- What I had to do was move apache+MySQL to new machine B.
- Move SMTP to new machine C.
- And keep DNS on old machine A.
- Machine A, B and C are networked locally on a second interface, but only machine A has the public internet routable IP.
- What is the best way to get machine A (192.168.0.1) to forward:
- - Incoming request on port 80+3306 to machine B (192.168.0.2)
- - Incoming request on port 25 to machine C (192.168.0.3)
- This would allow users to query the single IP address, but transparently have their requests forwarded to the correct machine.
- 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?
- Can I do it without the overhead of setting up a NAT on machine A?
- Thanks guys and keep up the good work on the show!
- Regards
- Simon, Australia
- PS:
- I know iptables can do this type of port forwarding within a single machine:
- 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.
- but this command doesn't work between multiple interfaces/machines.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement