ltm rule command LINK nexthop
iRule(1) BIG-IP TMSH Manual iRule(1)
LINK::nexthop
Returns the MAC address of the next hop.
SYNOPSIS
LINK::nexthop ('id' | 'type' | 'name')?
DESCRIPTION
Returns the MAC address of the next hop. Returns the broadcast address
ff:ff:ff:ff:ff:ff when called before a serverside connection has been
established. Note:
* In 11.4, you can use LINK::nexthop with sub-commands to retrieve
the id, type and name of the next hop, respectively. Without
sub-commands, LINK::nexthop returns the MAC address as before.
Syntax
LINK::nexthop [id]
* Returns the MAC address of the next hop.
LINK::nexthop type
* Returns the type of the next hop, namely "VLAN", "VLAN-GROUP",
"TUNNEL", "LOOPBACK" or "UNKNOWN".
LINK::nexthop name
* Returns the name of the next hop.
RETURN VALUE
LINK::nexthop [id]
* Returns the MAC address of the next hop.
LINK::nexthop type
* Returns the type of the next hop, namely "VLAN", "VLAN-GROUP",
"TUNNEL", "LOOPBACK" or "UNKNOWN".
LINK::nexthop name
* Returns the name of the next hop.
VALID DURING
EXAMPLES
# log requests
when CLIENT_ACCEPTED {
set info "client { [IP::client_addr]:[TCP::client_port] -> [IP::local_addr]:[TCP::local_port] }"
append info " ethernet { [string range [LINK::lasthop] 0 16] -> [string range [LINK::nexthop] 0 16] tag [LINK::vlan_id] qos [LINK::qos] }"
log local0. $info
}
# Logging example
when CLIENT_ACCEPTED {
log local0. "\[LINK::lasthop\]: [LINK::lasthop], \[LINK::nexhop\]: [LINK::nexthop]"
}
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]"
log local0. "\[serverside {LINK::nexthop}\]: [serverside {LINK::nexthop}] [serverside {LINK::nexthop type}] [serverside {LINK::nexthop name}] [serverside {LINK::nexthop id}]"
log local0. "\[serverside {LINK::lasthop}\]: [serverside {LINK::lasthop}] [serverside {LINK::lasthop type}] [serverside {LINK::lasthop name}] [serverside {LINK::lasthop id}]"
}
/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
: [clientside {LINK::lasthop}]: CLIENT_MAC, [clientside {LINK::nexthop}]: SERVER_MAC
: [LINK::lasthop]: SERVER_MAC, [LINK::nexhop]: CLIENT_MAC
: [serverside {LINK::nexthop}]: CLIENT_MAC VLAN /Common/inet2CLIENT_MAC
: [serverside {LINK::lasthop}]: SERVER_MAC VLAN /Common/snet SERVER_MAC
HINTS
SEE ALSO
LINK::lasthop
CHANGE LOG
@BIGIP-9.2.0 --First introduced the command. @BIGIP-11.4.0 --Added
subcommands: id, type, name
BIG-IP 2017-01-31 iRule(1)