IP::version

Description

Returns the IP version of a connection (“4” or “6”). When called in a clientside event, this command returns the IP version for the clientside connection. When called in a serverside event, this command returns the IP version for the serverside connection.

Syntax

IP::version

IP::version

  • Returns the IP version of a connection (“4” or “6”).

Examples

when CLIENT_ACCEPTED {
   log local0. "Client [IP::client_addr], VS: [IP::local_addr],\
      \[IP::version\]: [IP::version], \[IP::protocol\]: [IP::protocol]"
}

# Log output for a TCP connection over IPv4:
# <CLIENT_ACCEPTED>: Client 10.1.0.11, VS: 10.1.0.15, [IP::version]: 4, [IP::protocol]: 6

# Log output for a TCP connection over IPv6:
# <CLIENT_ACCEPTED>: Client fc00::1, VS: fc00::2, [IP::version]: 6, [IP::protocol]: 6