Operating System - Linux
1827636 Members
3434 Online
109966 Solutions
New Discussion

Clients Computers either can connect to Private network or Public Network, but not 2 both at a time

 
SOLVED
Go to solution
Maaz
Valued Contributor

Clients Computers either can connect to Private network or Public Network, but not 2 both at a time

All Gurus .... Plz Help

we have a remote office, to which we are connected via private network. I have set each computers'(clinets') default gateway, the Ip of Router's Ethernet Port, so that our whole network can communicate to the remote branch office's network.

on each client computer, I have issued the following command
#route add default gw 10.0.0.254
where 10.0.0.254 is the ip of Router's Ethernet Port.

Ok, now I have to configure Transparent Proxy, following lines are from squid.conf

httpd_accel_port 80
httpd_accel_with_proxy on
httpd_accel_host virtual
httpd_accel_uses_host_header on

but to use Tranparent-proxy, I have to change default gateway of each client computer from routers ethernet port's ip, to Squid server's eth0's ip(if i m not wrong), i.e I have to issued following command
#route add default gw 10.0.0.1
where 10.0.0.1 is the ip of Squid Server Ethernet Port.

In this particular situation client Computers at my branch can either connect to Public network(Internet), or to my Private network, i.e. when default gw is 10.0.0.254 client computers can just connect to my Private network, but when the default gateway is 10.0.0.1 client computers can connect to Internet only. But my requirement is to connect to the Internet, and to my Private Network simultaneously, from each client computers.

Hope I will have a solution soon :-)

Peace n Regards
Maaz

P.S. I must have to configure/run Transparent Proxy, i.e no Browser settings.

OS = red hat Linux 9
2 REPLIES 2
Alexander Chuzhoy
Honored Contributor
Solution

Re: Clients Computers either can connect to Private network or Public Network, but not 2 both at a time

as for network traffic-don't add second default gateway.
What you should have is one default gateway and static route entries for custom routes.
So in your case let's say that you do have a default gateway (the lp of the router).Now for the branch office simply add a static route:
route add -net 192.168.0.0 netmask 255.255.0.0 gw x.x.x.x

the example above adds a route to the network 192.168.0.0 via x.x.x.x (of course you should replace x.x.x.x with IP address).
This way of adding route is temporary-it doesn't remain across reboots.To permanently add a route-add entry to /etc/sysconfis/static-routes

Traditionally, static routes were added in /etc/sysconfig/static-routes, in the form:

iface type dest-addr netmask netmask gw gateway-addr ...

such as this example, taken from a real system:

eth0 net 192.168.0.0 netmask 255.255.0.0 gw x.x.x.x

Maaz
Valued Contributor

Re: Clients Computers either can connect to Private network or Public Network, but not 2 both at a time

Dear Alexander,

Many Thanks for ur kind and prompt support.
I m highly thankfull to u sir.
and I m also extremly sorry for replyin late.

Peace n Regards
Maaz