Forum Discussion
msmith_64485
Nimbostratus
Jan 25, 2010IP to FQDN
Looking for an irule that will replace the IP address of outgoing traffic with the FQDN. Issue is external server does not have a valid PTR record to allow resolution. Owner of this server does not ...
msmith_64485
Nimbostratus
Jan 28, 2010Aaron,
Yea I know they sent me here.....
So I added the rule and am receiving the logs
Jan 28 13:48:15 tmm tmm[1616]: Rule Test_Log : 10.10.101.183:1461: Connected to 1.1.1.1:443
So I am guessing I have something wrong in my replacement rule
when HTTP_REQUEST {
Check if Host header matches 1.1.1.1.
Use catch to handle non-IP Host values.
If IP::addr matches 1.1.1.1, $result will be 1
if {not ([catch {IP::addr [HTTP::host] equals 1.1.1.1} result]) && $result==1}{
HTTP::header replace Host "example.com"
}
}
when HTTP_REQUEST {
log local0. "[IP::client_addr]:[TCP::client_port]: [HTTP::method] request to [HTTP::host][HTTP::uri]"
Check if Host header matches 1.1.1.1.
Use catch to handle non-IP Host values.
If IP::addr matches 1.1.1.1, $result will be 1
if {not ([catch {IP::addr [HTTP::host] equals 1.1.1.1} result]) && $result==1}{
log local0. "[IP::client_addr]:[TCP::client_port]: Matched IP check for 1.1.1.1. Replacing host header"
HTTP::header replace Host "example.com"
}
}
when SERVER_CONNECTED {
log local0. "[IP::client_addr]:[TCP::client_port]: Connected to [IP::server_addr]:[TCP::server_port]"
}
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