LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 01-13-2005, 01:05 AM   #1
myheart
LQ Newbie
 
Registered: Oct 2004
Posts: 17

Rep: Reputation: 0
problem with squid and iptables


i use my mandrake 10.0 as a adsl gateway and transparent proxy. i installed squid and ppoe for adsl service. i configure iptables below :

iptables -t nat -A PREROUTING -i eth0 -p tcp --dport 80 -j REDIRECT --to-port 8080
iptables -t nat -A POSTROUTING -o ppp0 -j MASQUERADE
iptables -A FORWARD -i eth0 -j ACCEPT
iptables -A OUTPUT -j ACCEPT -m state --state NEW -o eth1 -p tcp --dport 80

echo 1 > /proc/sys/net/ipv4/ip_forward

my server also running an apache server for the local network, but it only can be browse using an ip address, i already add the erver name in /etc/hosts but it still not working, i think maybe it because of my iptables configuration, anybody have an idea ?
 
Old 01-13-2005, 02:43 PM   #2
ugge
Senior Member
 
Registered: Dec 2000
Location: Gothenburg, SWEDEN
Distribution: OpenSUSE 10.3
Posts: 1,028

Rep: Reputation: 45
The problem most likely is in your DNS configuration. DNS and NAT can be a real hassle.
Are your gateway also a DNS server? Do your clients use external DNS servers?
What are the policy settings for iptables? (iptables -L and iptables -t nat -L)
 
Old 01-13-2005, 07:34 PM   #3
myheart
LQ Newbie
 
Registered: Oct 2004
Posts: 17

Original Poster
Rep: Reputation: 0
no, i not configure my gate as a DNS and yes all my client is using an external DNS. here my policy setting

iptables -L

Chain INPUT (policy ACCEPT)
target prot opt source destination

Chain FORWARD (policy ACCEPT)
target prot opt source destination
ACCEPT all -- anywhere anywhere
ACCEPT all -- anywhere anywhere

Chain OUTPUT (policy ACCEPT)
target prot opt source destination

iptables -L -t nat

Chain PREROUTING (policy ACCEPT)
target prot opt source destination
REDIRECT tcp -- anywhere anywhere tcp dpt:http redir ports 8080

Chain POSTROUTING (policy ACCEPT)
target prot opt source destination
MASQUERADE all -- anywhere anywhere

Chain OUTPUT (policy ACCEPT)
target prot opt source destination

and thank you for your comment....
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
iptables+squid alcor Linux - Networking 1 11-02-2005 05:13 PM
squid management with IPtables shamza Linux - Networking 1 07-08-2005 03:13 PM
squid + iptables varun_saa Mandriva 10 02-11-2005 09:27 PM
Blocking squid through iptables jomy Linux - Networking 1 12-20-2004 09:24 AM
iptables and squid batfink Linux - Networking 3 09-15-2003 02:51 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 11:56 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration