April 26, 2024, 04:46:30 AM

News : LinuxSolved.com Linux Help Community Forum..


Author Topic: How to enable squid on gateway machine?  (Read 7096 times)

Offline mitak

  • Linux Noob !
  • *
  • Posts: 6
How to enable squid on gateway machine?
« on: April 09, 2004, 08:06:49 AM »
Hi,

i recently started a linux box as a gateway for our office network.
My ISP gave me a static IP and asked me to do SNAT to all packages in order to get access to Internet.
The box has two ethernets:

eth0(int)  : 192.168.0.2
eth1(ext) : 195.149.248.218

I've iptables running:
Code: [Select]
iptables -t nat -A POSTROUTING -o eth1 -j SNAT --to-source 195.149.249.65

The problem is that i cannot neither ping, trace or dir from that machine.

I want to start squid on that machine but it i don't know how to do it!

please  help!!!

Offline Ricky

  • LST CareTaker
  • Specially Skilled
  • *****
  • Posts: 2381
How to enable squid on gateway machine?
« Reply #1 on: April 10, 2004, 05:18:20 PM »
You have to make sure that your clients has gateway as the ip of your linux machine.
Secondly see Linux tutorial and how to preferrably..
a. Squid proxy configuration
b. Linux NAT / internet sharing how to to do your work.  I think that will do.

Offline mitak

  • Linux Noob !
  • *
  • Posts: 6
How to enable squid on gateway machine?
« Reply #2 on: April 13, 2004, 07:22:43 AM »
Hi Ricky,

thanks for the advice. I forgot to mention it but my clients are configured with gateway address of the linux box already.
They can browse without any problem.

My problem is that i cannot resolve or ping any address from the linux box itself.
May be this is due to the SNAT i'm doing...

Offline Ricky

  • LST CareTaker
  • Specially Skilled
  • *****
  • Posts: 2381
How to enable squid on gateway machine?
« Reply #3 on: April 13, 2004, 07:34:28 AM »
Ok instead of snat you do masqurade and tell us.. u can use that tutorial which have been posted here.. just change interface as your need..

Offline mitak

  • Linux Noob !
  • *
  • Posts: 6
How to enable squid on gateway machine?
« Reply #4 on: April 13, 2004, 09:01:07 AM »
Hi Ricky,

I read the tutorials and did exactly as it was written. Still there's no change

here's the output of cache.log
Code: [Select]
2004/04/13 10:57:21| Starting Squid Cache version 2.5.STABLE5 for i686-pc-linux-gnu...
2004/04/13 10:57:21| Process ID 1616
2004/04/13 10:57:21| With 1024 file descriptors available
2004/04/13 10:57:21| Performing DNS Tests...
FATAL: ipcache_init: DNS name lookup tests failed.
Squid Cache (Version 2.5.STABLE5): Terminated abnormally.
CPU Usage: 0.000 seconds = 0.000 user + 0.000 sys
Maximum Resident Size: 0 KB
Page faults with physical i/o: 271
FATAL: ipcache_init: DNS name lookup tests failed.
Squid Cache (Version 2.5.STABLE5): Terminated abnormally.
CPU Usage: 0.000 seconds = 0.000 user + 0.000 sys
Maximum Resident Size: 0 KB
Page faults with physical i/o: 271
2004/04/13 11:00:04| Starting Squid Cache version 2.5.STABLE5 for i686-pc-linux-gnu...
2004/04/13 11:00:04| Process ID 1621
2004/04/13 11:00:04| With 1024 file descriptors available
2004/04/13 11:00:04| Performing DNS Tests...

Mitko

Offline Ricky

  • LST CareTaker
  • Specially Skilled
  • *****
  • Posts: 2381
How to enable squid on gateway machine?
« Reply #5 on: April 13, 2004, 11:23:34 AM »
ok let me tell you one thing.. if you are trying to ping from client to www then you can't do that as you are using squid proxy.
If you have enabled masqurading or NAT on your linux box then you can ping www if you are not using transparent proxy ( if tp proxy then u cn't ping again)
Lastly you are saying that you are not able to ping www from ur linux box ie server. may you have somefirewall ..do u ?

Offline mitak

  • Linux Noob !
  • *
  • Posts: 6
How to enable squid on gateway machine?
« Reply #6 on: April 13, 2004, 11:39:31 AM »
Nope.

The only settings i have are for iptables - i don't have any firewall started.
as far as i understood there's some kind of game with the IPs.
Code: [Select]
my external IP is: 195.149.255.10
my gw is: 195.149.255.9

I have to make SNAT --to-source 195.149.249.65

Is it because the linux box is sending requests directly through the external interface without doing SNAT on its own requests?

Thanks.
Mitko

Offline Ricky

  • LST CareTaker
  • Specially Skilled
  • *****
  • Posts: 2381
How to enable squid on gateway machine?
« Reply #7 on: April 13, 2004, 04:04:43 PM »
Man you have to SNAT your external IP.. :)

Offline mitak

  • Linux Noob !
  • *
  • Posts: 6
How to enable squid on gateway machine?
« Reply #8 on: April 14, 2004, 06:28:11 AM »
Yes, but i don't know how  ? :(

Offline Ricky

  • LST CareTaker
  • Specially Skilled
  • *****
  • Posts: 2381
How to enable squid on gateway machine?
« Reply #9 on: April 14, 2004, 08:58:35 AM »
change ur --to-source to ur external address or simply followin internet sharing how to and do masqurading..

Offline mitak

  • Linux Noob !
  • *
  • Posts: 6
How to enable squid on gateway machine?
« Reply #10 on: April 14, 2004, 09:11:27 AM »
No,
I think you're wrong.
I have to do SNAT with second IP -- different from the one on the external interface! :(