Forum Discussion

CraigMo's avatar
CraigMo
Icon for Nimbostratus rankNimbostratus
Oct 04, 2018

LTM VE in Azure - irule not working

Created a LTM VE in Azure using 12.1.3 code. Using the gui created a vs as well as an irule. During testing does not appear the irule is being used. The log messages are not appearing in the ltm log file. Below is the VS config as well as the irule:

 

VS: ltm virtual fproxy-nproxyaware_443 { destination 10.254.0.13:https ip-protocol tcp mask 255.255.255.255 pool fproxy_pool_443 profiles { tcp { } } source 0.0.0.0/0 source-address-translation { pool forward-proxy_SNAT type snat } translate-address enabled translate-port enabled vs-index 25 }

 

iRule:

 

Select the first returned IP address as the destination IP (inherits the destination port from the client's destination port).

when RULE_INIT { set static::debug 1 set static::time_current [clock format [clock seconds] -format {%H:%M:%S}] log local0.alert "TIME: $static::time_current"

 

} when HTTP_REQUEST {

 

Get IP(s) for hostname against 4.2.2.1 name server set ips [RESOLV::lookup @8.8.8.8 -a [HTTP::header Host] ] log local0. "host [HTTP::header host]"

 

Log result. If there are multiple IP's it could be a TCL list like {1.1.1.1 2.2.2.2 3.3.3.3}. if ($static::debug) { log local0. "$static::time_current-Looked up [HTTP::header Host] and found $ips, parsed first element: [lindex $ips 0]" }

 

Check if the first list element was empty if {$ips eq ""}{ Input wasn't an IP address, take some default action? } else { Select the IP if ($static::debug) {log local0.alert "$static::time_current-Setting node [lindex $ips 0] and port [TCP::local_port]"} node [lindex $ips 0] [TCP::local_port] } }

 

The snat pool is configured with 10.254.15.6. Packet captures do not show any traffic from 10.254.15.6.

 

Using the forward proxy iApp works but using a non-proxy aware configuration does not work.

 

Any assistance is appreciated.

 

2 Replies

  • too much t/s... Here is the vs config with the irule and not a pool (though using a pool the vs works):

     

    ltm virtual fproxy-nproxyaware_443 { destination 10.254.0.13:https ip-protocol tcp mask 255.255.255.255 profiles { http { } tcp { } } rules { non-proxy-aware_irule } source 0.0.0.0/0 source-address-translation { pool forward-proxy_SNAT type snat } translate-address enabled translate-port enabled vs-index 25 }