Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I am working on a setup here and have it working with one minor exception.

Devices on one side of my bridge aren't getting SNAT'd to the Internet.


The Diagram / Overview:

                Primary_Network (Site_A)
                        |
                        |
Internet ------- Linux_Bridge_GW (GW)
                        |
                        |
                 Secondary/CoLo Site (Site_B)

Here is the setup:

  1. Site_A has all the production servers and workstations.
  2. Site_B has a set of servers that we would like to fail-over to and also serve our internet facing services from.
  3. GW has two interfaces that are trunked and carrying the appropriate VLAN traffic (allow layer-2 propagation of traffic between sites) //this all works perfectly fine.
  4. The problem that is being encountered is, hosts from Site_B have their default GW at Site_A (same subnet) GW does not have IPs on the VLANs that are being passed.
  5. All hosts at Site_A can reach the Internet without problem.
  6. GW has an addresses on a subnet that is ONLY for Internet destined traffic. (This was done so that Websense would not have to parse unnecessary traffic. We use this VLAN as the monitor port's source on the switch where Websense is sitting).

What I think is happening:

  1. Packet/Frame comes in on physdev at Site_B destined for Internet.
  2. Kernel sees packet, and forwards it out the other side of the bridge to that host's default GW.
  3. Site_A (containing core-network's Default-GW) sees that packet is destined for a host it doesn't know about, so it sends it to it's default GW (the linux bridge, since it's Internet bound).
  4. The kernel says "Hey, I've seen you before" and therefore doesn't do SNAT'ing on the packet and sends it out to the Internet where it's black-holed.

Why I think it's happening:

  1. A tcpdump on the internet facing NIC shows the packet leaving the interface with the private address as it's source.

What I would like:

  1. Have the packet SNAT'd.
  2. Something like the below would be awesome
    • packet comes in from Site_B
    • kernel sees that the packet is NOT destined for itself or any private address
    • kernel says "OK, well since you're destined for the Internet I'm going to send you out this interface rather than forward you to your normal default GW that's WAAAY over there."
    • packet comes in from internet and is sent out the appropriate bridge physdev depending on which site the host it's destined for is at.
share|improve this question

1 Answer 1

if the packets are being bridged, of course iptables will never see them.

Solution? use ebtables to redirect internet bound packets to the machine so that they will get the SNAT treatment (I'd use -j REDIRECT for MAC mangling)

share|improve this answer
    
I also would suggest using proxy arp instead of bridging - it would keep the whole ip filtering issue more manageable. –  the-wabbit Nov 23 '11 at 22:55

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.