Port Redirection with iptables (Log information)
The information from the lines that do the logging finally showed up, but I can't make heads or tails of them.
I'm getting a lot of lines that look like:
Dec 17 09:37:27 redpen kernel: NET: 61 messages suppressed. Dec 17 09:37:27 redpen kernel: Neighbour table
overflow.
But the number of messages keeps changing. And quite a few lines that look like...
Dec 17 09:37:30 redpen kernel: Iptables Error:IN=eth1
OUT= MAC=00:10:5a:26:ee:31:00:e0:b8:54:98:b0:08:00 SRC=10.10.0.252 DST=10.10.0.1 LEN=48 TOS=0x00 PREC=0x00 TTL=128 ID=1958 DF PROTO=TCP SPT=1068 DPT=80 WINDOW=16384 RES=0x00 SYN URGP=0
Thanks in advance...
Jason
Quoted 73 lines · --- Antony Stone
From: Antony Stone <[email protected]>
To: [email protected]
Subject: Re: Port Redirection with iptables
Date: Tue, 16 Dec 2003 16:25:16 +0000Quoted 1 line · Jason Cook
I am trying to install Linux as a firewall and
caching
Quoted 4 lines
server with iptables and Linux. I
need to do this transparently.I installed Red Hat Linux 9. Ran all of the
updates
Quoted 4 lines
nice and smooth. Turned on ip forwarding. Configured Squid...and tested it by specifying the servers ip address and port 3128 from the browser. Works great. Here the options I had
changed
Quoted 10 lines
in the config file.
http_port3128http_accessdenyto_localhost
aclour_networkssrc 10.0.0.0/8http_accessallowour_networkshttpd_accel_hostvirtualhttpd_accel_port80httpd_accel_with_proxyonhttpd_accel_uses_host_headeronI'm puzzled by this combination - are you trying to set up Squid as a caching
proxy, or as an accelerator (or both)?You do not need the acceleration options turned on to operate Squid as a
transparent proxy (and it is not generally recommended that you operate a
single instance of Squid in both modes simultaneously - you can do it, but
it's recommended to use two instances of Squid instead).Quoted 2 lines
For iptables I used
iptables -t nat -A PREROUTING -i eth1 -p tcp--dport
Quoted 8 lines
80 -j REDIRECT --to-port 3128
I then try to browse the internet from a client through the firewall and nothing.
When I run iptables -t nat -nv -L
Chain PREROUTING (policy ACCEPT 31254 packets,
3971K
Quoted 2 lines
bytes)
pkts bytes target prot opt in outsource
Quoted 7 lines
destination
0 0 REDIRECT tcp -- eth1 *
0.0.0.0/0 0.0.0.0/0 tcp dpt:80
redir ports 3128PREROUTING is accepting packets...but none are processes by the redirect rule.
I assume that eth1 is your internal LAN interface, so that's where the packets
will be coming from. Can you try adding some LOG
rules so we can see where
the packets are really going?
Quoted 18 lines
iptables -I PREROUTING -t nat -p tcp --dport 80 -j LOG
iptables -I INPUT -p tcp --dport 80 -j LOG iptables -I FORWARD -p tcp --dport 80 -j LOGAntony.
Signature · 8 lines
There are only 10 types of people in the world: those who understand binary notation, and those who don't. Please reply to the list; please don't CC me.
__________________________________
Do you Yahoo!?
New Yahoo! Photos - easier uploading and sharing.
http://photos.yahoo.com/
Quoted 5 lines
I'm getting a lot of lines that look like:
Dec 17 09:37:27 redpen kernel: NET: 61 messages suppressed. Dec 17 09:37:27 redpen kernel: Neighbour tableoverflow.
You may want to review the values of /proc/sys/net/ipv4/neigh/default/gc_thresh2 and .../gc_thresh3.
Signature · 4 lines
Dr George D M Ross, School of Informatics, University of Edinburgh
Kings Buildings, Mayfield Road, Edinburgh, Scotland, EH9 3JZ
Mail: [email protected] Voice: +44 131 650 5147 Fax: +44 131 667 7209
PGP: 1024/B74A4F7D 14 E8 B3 00 20 04 68 F8 95 40 CB 36 A4 D4 FA 90Quoted 5 lines
I'm getting a lot of lines that look like:
Dec 17 09:37:27 redpen kernel: NET: 61 messages suppressed. Dec 17 09:37:27 redpen kernel: Neighbour tableoverflow.
You may want to review the values of /proc/sys/net/ipv4/neigh/default/gc_thresh2 and .../gc_thresh3.
Signature · 4 lines
Dr George D M Ross, School of Informatics, University of Edinburgh
Kings Buildings, Mayfield Road, Edinburgh, Scotland, EH9 3JZ
Mail: [email protected] Voice: +44 131 650 5147 Fax: +44 131 667 7209
PGP: 1024/B74A4F7D 14 E8 B3 00 20 04 68 F8 95 40 CB 36 A4 D4 FA 90