dual ethernet and portforwarding

This is a discussion on dual ethernet and portforwarding within the Linux Networking forums, part of the Linux Forums category; I am having troube with portforwarding. I am using Redhat 9 with a custom kernal. I want my linux box ...


Go Back   Usenet Forums > Linux Forums > Linux Networking

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 03-02-2004
Lance Miller
 
Posts: n/a
Default dual ethernet and portforwarding

I am having troube with portforwarding. I am using Redhat 9 with a
custom kernal.

I want my linux box to sit inbetween the router and switch, and to
filter all 80 request to a cache server, and forward the rest of the
rest of the ports out the Internet

Swich ---------------> Eth0 ------------- -> Eth1-------------> Router

I have the following options compiled in the kernel:

Network support
Sysctl Suport
Network Packet Filtering
TCP/IP networking
Connection Tracking
IP Tables support
Full Nat
Redirect target support
/proc filesystem support


On startup I have I a custom starting the port forward command with

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

The interfaces look like this

[root@marfa root]# ifconfig
eth0 Link encap:Ethernet HWaddr 00:50:DA:5D:07:92
inet addr:89.11.5.204 Bcast:89.255.255.255 Mask:255.0.0.0
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:2102 errors:0 dropped:0 overruns:1 frame:0
TX packets:7 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:100
RX bytes:224339 (219.0 Kb) TX bytes:441 (441.0 b)
Interrupt:9 Base address:0x4000

eth1 Link encap:Ethernet HWaddr 00:50:DA:C3:FB:7C
inet addr:89.11.5.205 Bcast:89.255.255.255 Mask:255.0.0.0
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:2040 errors:0 dropped:0 overruns:0 frame:0
TX packets:104 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:100
RX bytes:214588 (209.5 Kb) TX bytes:10333 (10.0 Kb)
Interrupt:10 Base address:0x4080

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:10 errors:0 dropped:0 overruns:0 frame:0
TX packets:10 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:700 (700.0 b) TX bytes:700 (700.0 b)


And the route table looks like this:

Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref
Use Iface
89.0.0.0 * 255.0.0.0 U 0 0
0 eth1
89.0.0.0 * 255.0.0.0 U 0 0
0 eth1
127.0.0.0 * 255.0.0.0 U 0 0
0 lo
default 89.0.0.99 0.0.0.0 UG 0 0
0 eth0


Any Ideas on why this isn't working?

Thanks in advance!!!!

-Lance
Reply With Quote
  #2 (permalink)  
Old 03-04-2004
Cameron Kerr
 
Posts: n/a
Default Re: dual ethernet and portforwarding

Lance Miller <lance@blackfoot.net> wrote:
> I am having troube with portforwarding. I am using Redhat 9 with a
> custom kernal.
>
> I want my linux box to sit inbetween the router and switch, and to
> filter all 80 request to a cache server, and forward the rest of the
> rest of the ports out the Internet


In that case, all you need is a simple

Swicth -- (Eth0 -- PROXY -- Eth1) -- Router

iptables -t nat -A PREROUTING -i eth0 -p tcp \
--dport 80 -j REDIRECT --to-port 3128

You also need to tell squid that its acting as a transparent proxy. See
the Squid User Guide for more information.

http://squid-docs.sourceforge.net/la...tml/c2519.html

--
Cameron Kerr
cameron.kerr@paradise.net.nz : http://nzgeeks.org/cameron/
Empowered by Perl!
Reply With Quote
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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 Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT +1. The time now is 11:39 PM.


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.0.0