Forum Discussion
Josh_Hildebran1
Nimbostratus
Jul 13, 2006Simple SNAT for external SMTP nodes via a VIP
I think I had this working at some point, but now I'm not entirely sure it ever did.
I'm trying to make it so that external servers can use a VIP to hit a pool of external mail servers. When I say "external" I mean on the outside of the F5. I have a separate "internal", non-snatting VIP for internal servers to hit the SMTP server pool.
This external SMTP vip needs to SNAT so that the packets come back to the F5 properly.
Here is what I have so far:
virtual smtp_snat_external {
destination 172.20.150.25:smtp
ip protocol tcp
pool smtp_testpool
rule SMTP-Ext-SNAT
vlans external enable
}
rule SMTP-Ext-SNAT {
when CLIENT_ACCEPTED {
snat 172.20.150.201
}
pool smtp_testpool {
lb method member predictive
min active members 1
monitor all POST
member 192.168.168.76:smtp
member 192.168.170.50:smtp priority 2
}
monitor POST {
defaults from smtp
interval 30
timeout 61
debug "no"
domain "bigip-monitor.org"
}
When I'm on an external server, and telnet to the VIP at 172.20.150.25 port 25, I get a connection, but no SMTP banner. On the mail server, when I run a netstat, I see this connection:
tcp 0 0 192.168.170.50:25 172.20.150.201:1272 SYN_RECV
Which means the SNAT is working, but it seems to just hang there in SYN_RECV mode.. It never gets to ESTABLISHED.
What am I missing? I'm assuming it's an iRule problem.
Thanks so much!
- JRahm
Admin
As the ltm is not a firewall by nature, it doesn't treat vlans as outside/inside from a policy standpoint. That said, if you have a connection hitting a vip, and a pool of assigned servers that are *outside*, you'll need to snat to get the traffic to route back through the ltm. You can snat automap, or you can build a snatpool with 1 or more addresses in it. You shouldn't need a rule for this.pool smtp_testpool { lb method member predictive min active members 1 monitor all POST member 192.168.168.76:smtp member 192.168.170.50:smtp priority 2 } snatpool smtp_snatpool { member 172.20.150.25 } virtual smtp_snat_external { destination 172.20.150.25:smtp ip protocol tcp pool smtp_testpool snatpool smtp_snatpool vlans external enable }
- hoolio
Cirrostratus
Hi, - Josh_Hildebran1
Nimbostratus
Thanks citizen_elah.. I was apparently misdirected by your engineer that came down to do the install a while back. He was the one that said to use the iRule approach. I will try out your method and go from there.
Recent Discussions
Related Content
DevCentral Quicklinks
* Getting Started on DevCentral
* Community Guidelines
* Community Terms of Use / EULA
* Community Ranking Explained
* Community Resources
* Contact the DevCentral Team
* Update MFA on account.f5.com
Discover DevCentral Connects