ltm rule command LINK lasthop
iRule(1) BIG-IP TMSH Manual iRule(1)
LINK::lasthop
Returns the MAC address of the last hop.
SYNOPSIS
LINK::lasthop ('id' | 'type' | 'name')?
DESCRIPTION
Returns the MAC address of the last hop. Note:
* In 11.4, you can extend LINK::lasthop with sub-commands to retrieve
the lasthop id, type, name, respectively. Without sub-command,
LINK::lasthop returns the MAC address as before.
Syntax
LINK::lasthop [id]
* Returns the MAC address of the last hop.
LINK::lasthop type
* Returns the type of the last hop, namely "VLAN", "VLAN-GROUP",
"TUNNEL", "LOOPBACK" or "UNKNOWN".
LINK::lasthop name
* Returns the name of the last hop.
RETURN VALUE
LINK::lasthop [id]
* Returns the MAC address of the last hop.
LINK::lasthop type
* Returns the type of the last hop, namely "VLAN", "VLAN-GROUP",
"TUNNEL", "LOOPBACK" or "UNKNOWN".
LINK::lasthop name
* Returns the name of the last hop.
VALID DURING
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.
: [LINK::lasthop]: CLIENT_MAC, [LINK::nexhop]: ff:ff:ff:ff:ff:ff
: [LINK::lasthop]: CLIENT_MAC VLAN /Common/clientnet CLIENT_MAC
: [clientside {LINK::lasthop}]: CLIENT_MAC, [clientside {LINK::nexthop}]: SERVER_MAC
: [LINK::lasthop]: SERVER_MAC, [LINK::nexhop]: CLIENT_MAC
HINTS
SEE ALSO
LINK::nexthop
CHANGE LOG
@BIGIP-9.2.0 --First introduced the command. @BIGIP-11.4.0 --Added subcommands: id, type, name
BIG-IP 2022-04-12 iRule(1)