Forum Discussion

John_McInnes_44's avatar
John_McInnes_44
Icon for Nimbostratus rankNimbostratus
May 24, 2006

iRule for SNATing pool traffic to Virtual

Background:

All my pools have forwarding Virtual server's in and outbound because the pool members use real IP addresses. This is probably a kind of rare setup these days.

I run a Virtual for SMTP, for hosting 1000's of customer domains. Occaisionally a pool member will need to talk back to the Virtual. Usually this is when two customers send each other email.

Problem:

The pool members can't connect to the Virtual server of which it is a member in an IP forwarding environment.

Solution:

Apply this iRule to the Virtual. It will SNAT your Pool members when they try to connect to the Virtual.


when CLIENT_ACCEPTED {
  if { ( [matchclass [IP::remote_addr] equals $::DATAGROUP ] ) and ( [IP::addr [IP::local_addr] equals "virtual.ip.address"] ) }
  {
    log "Automapping [IP::remote_addr] -> [IP::local_addr]"
    snat automap
  }
  else
  {
    log "Not Automapping [IP::remote_addr] -> [IP::local_addr]"
  }
}

Where DATAGROUP is the name of a Data Group that contains the Pool subnet.

Hope it helps someone, as I searched here and didn't find anything that was specifically to solve this problem. Tested on LTM 3400 running 9.2.

No RepliesBe the first to reply