LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Networking (https://www.linuxquestions.org/questions/linux-networking-3/)
-   -   route from proxy server to internel servers (https://www.linuxquestions.org/questions/linux-networking-3/route-from-proxy-server-to-internel-servers-244863/)

mchitrakar 10-19-2004 08:18 PM

route from proxy server to internel servers
 
Dear friends,

I have a proxy server using squid with public address "w.x.y.z" and private address at 192.168.0.1. And intranet webserver at 192.168.0.3 beind this proxy server in internal lan, but now i also want to make this intranet server public. What routing command should I give or issue other procedures so that when accessing "http:\\w.x.y.z:80" from internet, the proxy server routes the request it to the 192.168.0.3. But these modifications should not affect the already ..squid operation .(That is request from internal sites should be forwarded as previously. )

Thanks

Demonbane 10-19-2004 08:42 PM

There's 2 ways you can do this, you can either run a reverse proxy, or you can use NAT and port forwarding. Both method should not affect your current configuration if done properly.

For a reverse proxy you can use Apache(mod_proxy and mod_rewrite) or Pound

For NAT + portforwarding the iptables rules should look something like below(assuming eth1 is your external interface),
Code:


iptables -t nat -A POSTROUTING -o eth1 -s 192.168.0.3 -j SNAT --to  w.x.y.z

iptables -t nat -A PREROUTING -i eth1 -p tcp --dport 80 -j DNAT --to  192.168.0.3

and you need to enable routing for this to work
echo "1" > /proc/sys/net/ipv4/ip_forward

mchitrakar 11-10-2004 05:38 AM

oopss.................
 
dear everyone,

thanks for helps..but oopss...it was very unfortunate..and something went
terribly wrong.....now all requests from local lan to internet that goes through
this server (thru squid) get acccess to 192.168.0.3 (intranet server)..
even if somebody tries to access www.google.com.np..link goes to
192.168.0.3....and only site opening is this site (from intranet server)
please do help me....please tell me how to undo this thing...
thnks


All times are GMT -5. The time now is 04:54 AM.