LINK::lasthop¶
Description¶
Returns the MAC address of the last hop.
Syntax¶
LINK::lasthop [id | name | type]
LINK::lasthop type¶
- Returns the type of the last hop, namely “VLAN”, “VLAN-GROUP”, “TUNNEL”, “LOOPBACK”, or “UKNOWN”
Examples¶
when CLIENT_ACCEPTED {
set lastmac [LINK::lasthop]
session add uie [IP::client_addr] $lastmac 180
}
# Logging example
when CLIENT_ACCEPTED {
log local0. "\[LINK::lasthop\]: [LINK::lasthop], \[LINK::nexhop\]: [LINK::nexthop]"
log local0. "\[LINK::lasthop\]: [LINK::lasthop] [LINK::lasthop type] [LINK::lasthop name] [LINK::lasthop id]"
}
when SERVER_CONNECTED {
log local0. "\[clientside {LINK::lasthop}\]: [clientside {LINK::lasthop}], \[clientside {LINK::nexthop}\]: [clientside {LINK::nexthop}]"
log local0. "\[LINK::lasthop\]: [LINK::lasthop], \[LINK::nexhop\]: [LINK::nexthop]"
}
/var/log/ltm output where CLIENT_MAC is the MAC address of the clientside hop and SERVER_MAC is the serverside hop.
<CLIENT_ACCEPTED>: [LINK::lasthop]: CLIENT_MAC, [LINK::nexhop]: ff:ff:ff:ff:ff:ff
<CLIENT_ACCEPTED>: [LINK::lasthop]: CLIENT_MAC VLAN /Common/clientnet CLIENT_MAC
<SERVER_CONNECTED>: [clientside {LINK::lasthop}]: CLIENT_MAC, [clientside {LINK::nexthop}]: SERVER_MAC
<SERVER_CONNECTED>: [LINK::lasthop]: SERVER_MAC, [LINK::nexhop]: CLIENT_MAC