Forum Discussion
Nat_Thirasuttakorn
Employee
Nov 22, 2004node command does not work with host name
I tested 9.0.1. and found that node command does not work with host name
any idea how to make it work? (with out creating pool)
for example:
if my_class = "something www.google.co.th"
and i use find class to get the node hostname
set $hostname [getfield [ findclass "something" $::my_class ] " " 2 ]
then i force bigip to connect directly to the hostname
node $hostname "80"
any suggestion would be appreciated.
NAT
18 Replies
- Nat_Thirasuttakorn
Employee
Thanks guys,
However, is it possible to add the ability to check name automatically if the node command follow by name not the ip address.
or even new command like
node-name server-1 port 80 - bl0ndie_127134Historic F5 AccountAdd the following to the "tmm_base.tcl" file and that should do the trick!
DNS UDP client (port 53) : <- UDP: proxy RESOLV { use server $IP_ADDR_LOCALHOST $service(domain) serverside UDP }
I also had to comment out the following lines from my /var/named/config/named.confoptions { listen-on port 53 { 127.0.0.1; }; listen-on-v6 port 53 { ::1; }; recursion yes; directory "/config/namedb"; allow-query { localhost; }; allow-transfer { localhost; }; forwarders { }; };
Well since you got me started, here is a rule from my 'secret stash' that shows how to make BigIP into a full blown http proxy.rule proxy_rule { when HTTP_REQUEST { set uri [HTTP::uri] set host [URI::host $uri] set port [URI::port $uri] set query [URI::query $uri] set basename [URI::basename $uri] if {[string bytelength $query] > 0} { set query [format "?%s" $query] } if {[string bytelength $basename] > 0} { set truncated [format "%s%s%s" [URI::path $uri] $basename $query ] } else { set truncated [format "%s%s" [URI::path $uri] $query] } if {[scan $host "%d.%d.%d.%d" a b c d] != 4} { HTTP::uri $truncated NAME::lookup $host HTTP::collect } else { use node $host 80 } } when NAME_RESOLVED { set address [NAME::response address 0] use node $address 80 HTTP::release } } - Marcel_Derksen_
Nimbostratus
CR44838 has been created to be able to use the configured node name with the node command. Please refer to the release notes to see if the CR has been resolved. - unRuleY_95363Historic F5 AccountDid you "bigstart restart tmm"? Changes to tmm_base.tcl require a tmm restart.
- Michael_Voight_Historic F5 AccountWhen I tested this recently, I found that NAME_RESOLVED is not hit until the second request, unless I use "HTTP::collect" in the HTTP Request stage. I also do the HTTP:release in the NAME_RESOLVED section as indicated earlier in this thread
- Davean_Hosang_1
Nimbostratus
Hi I am trying to configure my 9.4.6 system as a full blown proxy as above and the rule is giving me the below error. I am new to the rule creations so please let me know if I need to be substituting actual information in some of these commands.
BIGpipe rule creation error:
01070151:3: Rule [proxy_rule] error:
line 14: [undefined procedure: else] [else {
set truncated [format "%s%s" [URI::path $uri] $query]
} ]
Is there any difference with this version? - Davean_Hosang_1
Nimbostratus
Hi Natty, I basically copy and pasted the below rule from this forum. I don't see a "match" but the closed quote is there.
rule proxy_rule { when HTTP_REQUEST { set uri [HTTP::uri] set host [URI::host $uri] set port [URI::port $uri] set query [URI::query $uri] set basename [URI::basename $uri] if {[string bytelength $query] > 0} { set query [format "?%s" $query] } if {[string bytelength $basename] > 0} { set truncated [format "%s%s%s" [URI::path $uri] $basename $query ] } else { set truncated [format "%s%s" [URI::path $uri] $query] } if {[scan $host "%d.%d.%d.%d" a b c d] != 4} { HTTP::uri $truncated NAME::lookup $host HTTP::collect } else { use node $host 80 } } when NAME_RESOLVED { set address [NAME::response address 0] use node $address 80 HTTP::release } } - Nat_Thirasuttakorn
Employee
can you try this one ? I hope you use irule editor.when HTTP_REQUEST { set uri [HTTP::uri] set host [URI::host $uri] set port [URI::port $uri] set query [URI::query $uri] set basename [URI::basename $uri] if {[string bytelength $query] > 0} { set query [format "?%s" $query] } if {[string bytelength $basename] > 0} { set truncated [format "%s%s%s" [URI::path $uri] $basename $query ] } else { set truncated [format "%s%s" [URI::path $uri] $query] } if {[scan $host "%d.%d.%d.%d" a b c d] != 4} { HTTP::uri $truncated NAME::lookup $host HTTP::collect } else { use node $host 80 } } when NAME_RESOLVED { set address [NAME::response address 0] use node $address 80 HTTP::release }
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
