Forum Discussion
Techgeeeg_28888
Nimbostratus
Sep 10, 2015Irule to block users based on mac address
Hi Everyone,
I would like to know from experts that is there a way irule can be used to block the users access to the application based on their mac address. Will this be achievable using irule ...
Hannes_Rapp
Nimbostratus
Sep 14, 2015LTM iRule config
ltm rule /Common/irule_l2_mac_whitelist {
when CLIENT_ACCEPTED {
if {[class match [LINK::lasthop] equals "data_l2_mac_whitelist"]}{
log local0. "Client: <[IP::client_addr]:[TCP::client_port]> MAC <[LINK::lasthop]>. Permitted"
return
} else {
log local0. "Client: <[IP::client_addr]:[TCP::client_port]> MAC <[LINK::lasthop]>. Dropped"
drop
}
}
}
LTM data-group config
ltm data-group internal /Common/data_l2_mac_whitelist {
records {
ff:ff:ff:ff:ff:ff { data dummy-mac }
}
type string
}
Connecting to service and checking logs (/var/log/ltm)
Sep 14 06:47:11 ccwdlqa-lb01 info tmm[15097]: Rule /Common/irule_l2_mac_whitelist : Client: <172.31.8.11:43470> MAC <00:1b:21:b1:f1:91>. Dropped
Adding my MAC to whitelist data-group
hannesr@ccwdlqa-lb01(cfg-sync Changes Pending)(Active)(/Common)(tmos) modify ltm data-group internal data_l2_mac_whitelist records add { 00:1b:21:b1:f1:91 }
Connecting to service and checking logs (/var/log/ltm)
Sep 14 06:48:22 ccwdlqa-lb01 info tmm1[15097]: Rule /Common/irule_l2_mac_whitelist : Client: <172.31.8.11:43471> MAC <00:1b:21:b1:f1:91>. Permitted
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