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 want to add PTR and communication with this server is required. If there is a better way to address this issue please direct me to it.
30 Replies
Sort By
- msmith_64485
Nimbostratus
No connection will work if I use the actual FQDN but fails if I use the ip and host command with HTTP/1.1 400 Bad Request. - hoolio
Cirrostratus
So you could try configuring the VIP on port 80, the pool member(s) on port 443, and add the iRule. If you give that a go and it doesn't work, can you add logging to the iRule to make sure the Host header replacement is being done? - msmith_64485
Nimbostratus
ok, what would the logging look like? - hoolio
Cirrostratus
Hi Mike,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 "www.example.com" } } when SERVER_CONNECTED { log local0. "[IP::client_addr]:[TCP::client_port]: Connected to [IP::server_addr]:[TCP::server_port]" }
- msmith_64485
Nimbostratus
OK, thanks, actually think I am getting better support from you!! - msmith_64485
Nimbostratus
Aaron, - hoolio
Cirrostratus
So that log line shows the connection being established with the server. Do you see a log line from these two previous log lines? - msmith_64485
Nimbostratus
Jan 28 13:58:50 tmm tmm[1616]: Rule Test_Log : 10.10.101.183:1688: Connected to 1.1.1.1:443 - hoolio
Cirrostratus
Okay, so the iRule is looking for a request which contains the host header of 1.1.1.1. If the VIP is 2.2.2.2, then you can change the rule to check for 2.2.2.2. Or if you just want to rewrite the host header for all requests, you can remove the if check:when HTTP_REQUEST { Replace the host header with www.example.com HTTP::header replace Host "www.example.com" }
- msmith_64485
Nimbostratus
Aaron,
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