December 13, 2017, 06:36:27 PM

News : LinuxSolved.com Linux Help Community Forum..


Author Topic: gateway problem  (Read 1664 times)

Offline ranadastidar

  • Linux Noob !
  • *
  • Posts: 5
gateway problem
« on: August 25, 2009, 09:08:48 AM »
In our office network we are using squid proxy as our proxy server. Earlier we are using broadband and its was ppoe now we changed our isp and now they provide fixed ip. They provide one router and our server connected with that router. Our present network like this

eth0----- for local network -- ipaddress 192.168.0.100
eth1------for internet connected with router-- ipaddress 192.168.1.2 and gateway is 192.168.1.1
i can ping the gateway from our proxy server but we cant use internet from any other machine on the network , pls help

Offline pedro

  • Linux Noob !
  • *
  • Posts: 14
Re: gateway problem
« Reply #1 on: August 30, 2009, 03:56:44 PM »
Let's see if I understood correctly. You "gateway" is the proxy server, the rest of the network has ip addresses in the 192.168.0.x range, and 192.168.0.100 as their router, right?

The server should route (NAT) the requests to the internet through the ISP router (192.168.1.2). You may only need to route web browsing through the gateway.

In any case, you need to enable ip_forwarding in the gateway, and add a few rules to the firewall configuration.

Please clarify... do you want a transparent proxy?

Pedro.

Offline gauravbajaj

  • LST CareTaker
  • Experienced
  • *****
  • Posts: 658
Re: gateway problem
« Reply #2 on: September 02, 2009, 04:55:12 AM »
Pedro is right. You cant use internet on other boxes unless you enable ip forwarding and NAT. You have to use some iptables rule similar like below

iptables -t nat -A POSTROUTING -s ipaddrr/netmask -j SNAT -o eth0 --to-source ipadd.

Check for it and change it acc to your needs




 

« Last Edit: September 03, 2009, 06:21:07 AM by gauravbajaj »