Forum Discussion
Egbert_Bryant_1
Nimbostratus
Oct 04, 2006TCP Port Redirect
I am trying to write the following rules and I am getting errors on line 1, 6, and 10. please let me know what I am doing wrong.
class ports {
80
443
}
when CLIENT_ACCEPTED {
if { [matchclass [TCP::client_port ] equals $ports ]}
node 167.206.169.130
} else {discard}
}
6 Replies
- Nathan_Pearce_4Historic F5 AccountRegarding formatting try:
when CLIENT_ACCEPTED {
if {[matchclass [TCP::client_port ] equals $ports ]}{
node 167.206.169.130
} else {
discard
}
}
Must catch bus.... will take another look tomorrow! - Nathan_Pearce_4Historic F5 AccountTo create a class to match against, in the Big-IP Web interface, navigate to: "Local Traffic -> Virtual Servers -> iRules" and then click on the "Data Group List" tab.
From here click, enter a name and add some integers to match your TCP Ports.
Hope this helps. - Deb_Allen_18Historic F5 AccountYou'll also need to use global variable syntax to reference a class, as classes are global constructs:
when CLIENT_ACCEPTED { if {[matchclass [TCP::client_port ] equals $::ports]}{ node 167.206.169.130 } else { discard } }
/deb - Deb_Allen_18Historic F5 Account(and I think what Nato is getting at is that the class is not part of the rule itself, instead must be created elsewhere and referenced by the iRule)
/deb - Deb_Allen_18Historic F5 AccountThere was also a missing a curly brace in my rule revision above -- I've edited to correct that.
- Egbert_Bryant_1
Nimbostratus
Thanks, however it looks like the rule is not working. I have the rule applied to a virtual server with the following setup. and I see that there's too much traffic. I am trying to control traffic from my inside clients trying to access the internet - I would like to redirect specific ports to the ISP with the most bandwidth.
network 0.0.0.0/0.0.0.0
and all ports
Help guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)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