LinuxQuestions.org
Share your knowledge at the LQ Wiki.
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 11-14-2006, 07:47 PM   #1
alouks
LQ Newbie
 
Registered: Aug 2006
Posts: 6

Rep: Reputation: 0
Squid Question


Okay, so i've tried reading up information on creating a transperant proxy...but they're only talking about creating a proxy over a lan.

My case happens to be:

2 Public IP addresses.

1 address needs to route to the other when accessed.


Say if i type in www.whatever.com (which happens to be x.x.x.25)

That needs to be routed to another web server (x.x.x.130)


Is there any way in setting this up...i'm a bit at a loss.


Thanks in advance for the help.

-Aaron-
 
Old 11-15-2006, 06:11 AM   #2
amitsharma_26
Member
 
Registered: Sep 2005
Location: New delhi
Distribution: RHEL 3.0/4.0
Posts: 777

Rep: Reputation: 31
Okay, so i've tried reading up information on creating a transperant proxy...but they're only talking about creating a proxy over a lan.
They doesnt explicitly says to cater LAN; but infact its a client-set with an IP series.

My case happens to be:
2 Public IP addresses.
1 address needs to route to the other when accessed.
Is this fixed that the client-set will sit behind only one IP-address(ethernet interface) ?
I mean; Will that be input from eth0 to output to eth1 or vice-versa or bothways ?


Say if i type in www.whatever.com (which happens to be x.x.x.25)
That needs to be routed to another web server (x.x.x.130)
Is there any way in setting this up...i'm a bit at a loss.
You can always set this by setting up
tcp_outgoing_address <public-address-1(public-address-to-use-to-go-out> <client-set-maybe(0/0)>


& further the main thing in your case would be routing tables (routes). And instead of conventional destination driven routing; you would be requiring source driven routing.
 
Old 11-15-2006, 10:14 AM   #3
alouks
LQ Newbie
 
Registered: Aug 2006
Posts: 6

Original Poster
Rep: Reputation: 0
amitsharma, i'm not entirely sure what you mean.

I have a web server currently set to a static ip (x.x.x.45) on eth0:1
On eth0:2 i have another ip address (x.x.x.67) When the .67 address is accessed, i need it to route traffic to ANOTHER web server (x.x.x.130)

Perhaps you're right, it would be easier just setting up a routing table instead of using a proxy, but i need masking. I don't want to expose the .130 address to the world directly.
 
Old 11-15-2006, 11:42 AM   #4
amitsharma_26
Member
 
Registered: Sep 2005
Location: New delhi
Distribution: RHEL 3.0/4.0
Posts: 777

Rep: Reputation: 31
Quote:
Originally Posted by alouks
I have a web server currently set to a static ip (x.x.x.45) on eth0:1
On eth0:2 i have another ip address (x.x.x.67) When the .67 address is accessed, i need it to route traffic to ANOTHER web server (x.x.x.130)
Code:
iptables -t nat -A PREROUTING -i eth0:2 -d x.x.x67 -j DNAT --to x.x.x.130
Now about the routing part for which you want these x.x.x.130 packets to traverse out from a selective interface;
(only if you do not want these packets to traverse out via default route)

Create a rule for this;
Code:
ip ru add to x.x.x.130 table 100
& route for the above mentioned table;
Code:
ip route via <gateway-ip-of-the-interface-you-want-this-to-go-out> table 100
& if you happen to have same gateway-ip for different ips; then you can also mention dev eth<x> in the above ip route command.

run
Code:
#ip rou flush cache
& thts it you are done !!!

// The reason for creating the rule for this route to be processed prior to the default route(static kernel routing tables).

Last edited by amitsharma_26; 11-16-2006 at 07:27 AM.
 
Old 11-15-2006, 06:53 PM   #5
alouks
LQ Newbie
 
Registered: Aug 2006
Posts: 6

Original Poster
Rep: Reputation: 0
You're my hero Amitsharma! Thank you.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
squid question yongitz Linux - Networking 2 11-11-2006 07:45 AM
squid question ilnli Linux - Software 2 11-13-2005 11:54 PM
squid question heraklez Slackware 3 07-30-2005 02:53 PM
Squid Question offaxis Debian 1 09-27-2004 04:03 PM
Squid Question kemplej Linux - Networking 0 04-22-2004 04:28 PM

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

All times are GMT -5. The time now is 01:34 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