LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Networking (https://www.linuxquestions.org/questions/linux-networking-3/)
-   -   Squid Question (https://www.linuxquestions.org/questions/linux-networking-3/squid-question-501643/)

alouks 11-14-2006 07:47 PM

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-

amitsharma_26 11-15-2006 06:11 AM

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.

alouks 11-15-2006 10:14 AM

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.

amitsharma_26 11-15-2006 11:42 AM

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).

alouks 11-15-2006 06:53 PM

You're my hero Amitsharma! Thank you.


All times are GMT -5. The time now is 11:47 AM.