linux routing - TechRepublic
General discussion
April 20, 2003 at 09:10 PM
avswamy

linux routing

by avswamy . Updated 21 years, 5 months ago

I have a problem in routing a natting server to squid server, my setup is

router
? |
? |
-switch—
?| ?????????????|
?| ??????????????????????????????????|
natting server(eth0, eth1) ???????Squid server(eth0)

my router address is 200.200.0.1
natting server eth0 is 200.200.0.2
??????????????eth1 is 192.168.1.1
squid server eth0 is 200.200.0.3

all my clients are on private network as 192.168.0.0, and i want to route these clinet http requests to squid server, so i implemented as follows.

squid Server:iptables -t nat -A PREROUTING -i eth0 -p tcp –dport 80 -j REDIRECT –to-port 3128

natting server:
iptables -A PREROUTING -i eth0 -t mangle -p tcp –dport 80 -j MARK –set-mark 2
echo 202 www.out >> /etc/iproute2/rt_tables
ip rule add fwmark 2 table www.out
ip route add default via 200.200.0.3 dev eth0 table www.out
ip route flush cache
now i am not routing to squid server my error in browser is

The requested URL could not be retrieved

While trying to retrieve the URL: /

The following error was encountered:

Invalid URL
Some aspect of the requested URL is incorrect. Possible problems:

Missing or incorrect access protocol (should be `http://” or similar)
Missing hostname
Illegal double-escape in the URL-Path
Illegal character in hostname; underscores are not allowed

and my config details

ip rule ls
0: ?????from all lookup local
32765: ?from all fwmark 0x2 lookup www.out
32766: ?from all lookup main
32767: ?from all lookup 253

ip route list table www.out
default via 200.200.0.3 dev eth0

ip route
200.200.0.2/29 dev eth0 ?scope link
192.168.0.0/24 deveth1 ?scope link
127.0.0.0/8 dev lo ?scope link
default via 200.200.0.1 dev eth0

can any one give me a solution reg this error, thanks for all the support your are providing.

This discussion is locked

All Comments