LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
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 09-15-2003, 12:03 PM   #1
batfink
LQ Newbie
 
Registered: Aug 2003
Posts: 2

Rep: Reputation: 0
Question iptables and squid


Hey there,

I am using squid running on RH9 to allow web proxing. Clients Win98 and Win2k and WinNT Server.

I am an newbie to Linux but I nave been researching how to allow my users to access pop3 port 110 (outlook and express) to access external isp mail server ( 200.10.152.55) but to no avail. have been trying to use iptables but still cannot ping mail server from clients or linux box. Have included some relevant info. any hints would be greatly appreciated.

Thanks

eth0 Link encap:Ethernet HWaddr 00:48:54:67:CF:97
inet addr:10.223.1.35 Bcast:10.223.1.255 Mask:255.255.255.0
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:7589 errors:0 dropped:0 overruns:0 frame:0
TX packets:9830 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:100
RX bytes:975044 (952.1 Kb) TX bytes:11250988 (10.7 Mb)
Interrupt:11 Base address:0xf000

eth1 Link encap:Ethernet HWaddr 00:04:75:7E:48:65
inet addr:10.0.0.1 Bcast:10.255.255.255 Mask:255.0.0.0
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:10344 errors:0 dropped:0 overruns:1 frame:0
TX packets:8447 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:100
RX bytes:10917078 (10.4 Mb) TX bytes:1011510 (987.8 Kb)
Interrupt:10 Base address:0xac00

lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
UP LOOPBACK RUNNING MTU:16436 Metric:1
RX packets:11293 errors:0 dropped:0 overruns:0 frame:0
TX packets:11293 errors:0 dropped:0 overruns:0 carrier:0

Here is the script been working with

#!/bin/sh
echo "Setting up IP masquerading"
#Support masquerading of FTP file trasnfer
echo "1" > /proc/sys/net/ipv4/ip_forward
IPTABLES=/sbin/iptables
EXTIF="eth1"
INTIF="eth0"
echo "External Interface: $EXTIF"
echo "Internal Interface: $INTIF"
echo -en "iptable_nat,"
/sbin/insmod iptable_nat
#echo -en "ip_nat_ftp,"
/sbin/insmod ip_nat_ftp
echo ". Done Loading all modules."
# Enable ip forwading and masquerading
echo " clearing any existing rules and setting default policy.."
$IPTABLES -P INPUT ACCEPT
$IPTABLES -F INPUT
$IPTABLES -P OUTPUT ACCEPT
$IPTABLES -F OUTPUT
$IPTABLES -P FORWARD DROP
$IPTABLES -F FORWARD
$IPTABLES -t nat -F
echo "FWD: Allow all connections OUT and only existing and related ones IN"
#$IPTABLES -A FORWARD -d 10.0.0.138 -i $EXTIF -o $INTIF -p tcp --dport 110 -j ACCEPT
$IPTABLES -A FORWARD -i $EXTIF -o $INTIF -m state --state ESTABLISHED,RELATED -j ACCEPT
$IPTABLES -A FORWARD -i $INTIF -o $EXTIF -j ACCEPT
$IPTABLES -A FORWARD -j LOG --log-prefix "UNMATCHED FORWARD"
echo "Enabling SNAT (MASQUERADE) functionality on $EXTIF"
$IPTABLES -t filter -A OUTPUT -o $EXTIF -p icmp -j ACCEPT
$IPTABLES -t nat -A POSTROUTING -o $EXTIF -j MASQUERADE

Result of ping
[root@KGNPROXY root]# ping -c 2 -t 1 200.10.152.55
PING 200.10.152.55 (200.10.152.55) 56(84) bytes of data.
From 10.0.0.138 icmp_seq=1 Time to live exceeded
From 10.0.0.138 icmp_seq=2 Time to live exceeded

--- 200.10.152.55 ping statistics ---
2 packets transmitted, 0 received, +2 errors, 100% packet loss, time 1013ms



What am i doing wrong?
 
Old 09-15-2003, 01:27 PM   #2
hakcenter
Member
 
Registered: Apr 2003
Location: Not to far from the computer screen
Distribution: RedHat 9.0
Posts: 324

Rep: Reputation: 30
I hate scripts personally bro.. no offense it just makes it so much harder for me to read.

Click the link in my sig, that'll help.
 
Old 09-15-2003, 02:24 PM   #3
batfink
LQ Newbie
 
Registered: Aug 2003
Posts: 2

Original Poster
Rep: Reputation: 0
Thanks ,

Just one question in script u sent what is represented by WAN and LAN ( or eth0 and eth1) ?
 
Old 09-15-2003, 02:51 PM   #4
win32sux
LQ Guru
 
Registered: Jul 2003
Location: Los Angeles
Distribution: Ubuntu
Posts: 9,870

Rep: Reputation: 380Reputation: 380Reputation: 380Reputation: 380
well, to talk to the external mail server you just need the linux box to be routing properly...

squid is for accelerating the surfing and saving bandwidth and that sorta stuff (yes, you can use it to share one ip address but that's not the point)...

if you can't ping the internet from the linux router or the lan then something's wrong... are you sure you have the ip configuration set-up correctly? in other words, can you ping the net from the router when iptables is flushed???

try flushing iptables with something like this:

http://www.linuxguruz.org/iptables/s...h-iptables.txt

can you now ping the net from the router???

okay, you could then try using an iptables script generated here to set-up the router for your network (i've tried it and it works nicely):

http://morizot.net/firewall/gen/

good luck!!!
 
  


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 + iptables varun_saa Mandriva 10 02-11-2005 09:27 PM
iptables, DansGuardian, and Squid. cth3 Linux - Networking 1 02-10-2005 09:04 AM
Blocking squid through iptables jomy Linux - Networking 1 12-20-2004 09:24 AM
Iptables / Squid Configuration aushtosh Linux - Security 2 04-09-2002 11:57 PM

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

All times are GMT -5. The time now is 11:55 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