Fortinet white logo
Fortinet white logo

Script Reference Guide

IP commands

IP commands

IP commands contain functions to obtain IP layer related information such as obtaining the IP address and port of the server and client:

  • IP:client_addr() — Returns the client IP address of a connection; for the frontend, it will return the source address, while for the backend, it will return the destination address.

  • IP:server_addr() — Returns the IP address of the server in the backend.

  • IP:local_addr() — For the frontend, it returns the IP address of the virtual server that the client is connected to. For the backend, it returns the incoming interface IP address of the return packet.

  • IP:remote_addr() — Returns the IP address of the host on the far end of the connection.

  • IP:client_port() — Returns the client port number.

  • IP:server_port() — Returns the server port number. It is the real server port.

  • IP:local_port() — Returns the local port number. In the frontend, the local port is the virtual server port. In the backend, the local port is the port used to connect to the gateway.

  • IP:remote_port() — Returns the remote port number. In the frontend, the remote port is the client port. In the backend, remote port is the real server port.

  • IP:client_ip_ver() — Returns the current client IP version number of the connection, either 4 (for IPv4) or 6 (for IPv6).

  • IP:server_ip_ver() — Returns the current server IP version number of the connection, either 4 (for IPv4) or 6 (for IPv6).

IP commands

IP commands

IP commands contain functions to obtain IP layer related information such as obtaining the IP address and port of the server and client:

  • IP:client_addr() — Returns the client IP address of a connection; for the frontend, it will return the source address, while for the backend, it will return the destination address.

  • IP:server_addr() — Returns the IP address of the server in the backend.

  • IP:local_addr() — For the frontend, it returns the IP address of the virtual server that the client is connected to. For the backend, it returns the incoming interface IP address of the return packet.

  • IP:remote_addr() — Returns the IP address of the host on the far end of the connection.

  • IP:client_port() — Returns the client port number.

  • IP:server_port() — Returns the server port number. It is the real server port.

  • IP:local_port() — Returns the local port number. In the frontend, the local port is the virtual server port. In the backend, the local port is the port used to connect to the gateway.

  • IP:remote_port() — Returns the remote port number. In the frontend, the remote port is the client port. In the backend, remote port is the real server port.

  • IP:client_ip_ver() — Returns the current client IP version number of the connection, either 4 (for IPv4) or 6 (for IPv6).

  • IP:server_ip_ver() — Returns the current server IP version number of the connection, either 4 (for IPv4) or 6 (for IPv6).