Forum Discussion
iRule for mac address identification
I am using the iRule statement "set macparta [[lindex [split $radname1 "-" ] 5 ]" for the calling station id (containing the MAC address) field is (with as separator “-“) But if the MAC addressfield is with as separator “:“) . How will be my iRule statement to work in both case .
For E.g; if the Calling-Station-Id mac address format is
Calling-Station-Id = "2C-1F-23-45-3B-1E" Calling-Station-Id = "dc:9b:9c:cd:43:e5"
3 Replies
- Vijay_E
Cirrus
Use log local0 in order to identify how it would look.
set macparta [[lindex [split $radname1 "-" ] 5 ]Assuming, $radname1 refers to the Calling-Station-Id, the answer would be 1E for MAC address with - and it won't work for MAC address with :
- Stanislas_Piro2
Cumulonimbus
Hi,
you can convert the calling station id with the expected format:
set radname1 "2C:1F:23:45:3B:1E" set radname1 [string map {: -} $radname1] set macparta [[lindex [split $radname1 "-" ] 5 ] Hi Sukumar,
how about using a
command which splits the input MAC on both the ":" or "-" char at the same time...[split]set radname1 "2C:1F-23:45-3B:1E" set macparta [[lindex [split $radname1 ":-" ] 5 ]Cheers, Kai
Help guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)Recent Discussions
Related Content
* 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