Networking Forums

Networking Forums > Computer Networking > Linux Networking > Redirecting ports in a bridge

Reply
Thread Tools Display Modes

Redirecting ports in a bridge

 
 
Ganso
Guest
Posts: n/a

 
      04-18-2008, 09:30 AM
Hi.
I have a linux appliance from Eneo Tech. (http://
www.eneotecnologia.com/) with the following setup:

(192.168.1.x)
192.168.1.7 ----
SERVER1 192.168.2.1
[ LAN1 ] ----------- [ ROUTER ] ---------- [ APPLIANCE ] --------
[ LAN 2 ] --------|
192.168.2.7 192.168.2.140
(192.168.2.x) ---- SERVER2 192.168.2.2

The appliance has 4 ethernet cards, and a br0 bridge which includes
all them. ETH2 is connected to the router, ETH3 is connected to LAN2,
and BR0 has an IP address of LAN2.

Now, I want to redirect all HTTP traffic going to SERVER1, to the same
port SERVER2.

I've tried the following rule:

iptables -t nat -A PREROUTING -p tcp -d 192.168.2.1 --dport 80 --to-
destination 192.168.2.2:80 -j DNAT


The redirection seems to be working, as far as I've seen with tcpdump
on SERVER2, but I'm not able to make a connection.

I have two suppositions:

1) I have to SNAT the response. I've tried that rule:
iptables -t nat -A POSTROUTING -p tcp --sport 80 -s 192.168.2.2 -d
192.168.1.0/24 -j SNAT --to-source 192.168.2.1

2) I have to use ebtables, as I'm using a bridge.

Any help? Thanks in advance :-)
 
Reply With Quote
 
 
 
Reply

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
redirecting packets david.toneian@gmail.com Linux Networking 5 12-17-2006 02:03 PM
redirecting subdomain jennifersahn@gmail.com Linux Networking 1 09-29-2005 08:40 PM
Redirecting traffic from AP Coenraad Loubser Linux Networking 5 04-29-2005 12:46 PM
redirecting connections salvo Linux Networking 2 02-13-2005 06:54 PM
Redirecting com ports Jeff Jacobson Windows Networking 0 02-11-2004 01:29 AM



1 2 3 4 5 6 7 8 9 10 11