LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 10-19-2004, 08:18 PM   #1
mchitrakar
Member
 
Registered: Mar 2004
Posts: 93
Blog Entries: 1

Rep: Reputation: 15
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
 
Old 10-19-2004, 08:42 PM   #2
Demonbane
LQ Guru
 
Registered: Aug 2003
Location: Sydney, Australia
Distribution: Gentoo
Posts: 1,796

Rep: Reputation: 47
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
 
Old 11-10-2004, 05:38 AM   #3
mchitrakar
Member
 
Registered: Mar 2004
Posts: 93

Original Poster
Blog Entries: 1

Rep: Reputation: 15
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
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Knoppix and Proxy servers phuqmnb Linux - Newbie 1 12-19-2004 11:53 AM
Proxy servers the_imax General 3 12-13-2004 12:04 AM
snort and proxy servers zuessh Linux - Security 8 03-08-2004 06:41 PM
Proxy Servers... Grim Reaper Linux - Security 6 02-03-2003 03:24 PM
Two domains, linux router, Route 1 domain to internel comp. lil_critter99 Linux - Networking 1 02-09-2002 02:16 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 05:42 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration