I have 3 normal desktop machine A,B and C which are part of same network. I have an apache web server on C. I want to have a scenario to test where i would like to route requests from A to C always through B. Is it possible to achieve this? B is not a designated gateway machine, its one of my normal desktop machines. Can i play around with routing table for achieving this? Please advice. B runs linux always and A and C can be any OS (for now i am using Windows).
Thanks in advance.
Do you mean something like setting up a proxy/socks tunnel? You could use ssh with the -D switch to create a tunnel from a port on A through to B.
E.g. run the below command on A then you should be able to point your web browser proxy configuration to port 8080 on your local computer (A) and everything will go through B
If you want it to run until you shut computer A down you can use the -f switch as well which will send that ssh command into the background.
Note, you'll need ssh on machine B (you're running linux so no problem there) but you'll also need it on machine A. You could try Cygwin but it would be easier to install putty on machine A. (google for setting up a socks proxy login with putty -- it is quite easy and there are be plenty of tutorials)
If machiens A, B and C are on the same network, that can easily be done bvy some host-specific routes on A and C. Normally, IP forwarding is disabled under linux, so you will have to enable that.
Alternatively:
If host A is 10.1.2.3/24, host B is 10.1.2.4/24 and host C is 10.1.2.5/24, you'll need routes added as below. Host A:
Host C:
Equivalent routing should be doable under Windows, but I don't have the commands readily at hand.