Fortinet Document Library

Version:


Table of Contents

5.3.0
Download PDF
Copy Link

IP commands

IP:Client_addr()

Returns the client IP address of a connection; for frontend it will return source address, while for back end, it will return destination address.

Syntax

cip=IP:client_addr()

Arguments: N/A

Examples:

when SERVERSSL_HANDSHAKE {

cip=IP:client_addr()

lip=IP:local_addr()

sip=IP:server_addr()

rip=IP:remote_addr()

cp=IP:client_port()

lp=IP:local_port()

sp=IP:server_port()

rp=IP:remote_port()

sipv=IP:server_ip_ver();

cipv=IP:client_ip_ver();

debug("in server ssl with remote addr %s:%s client %s:%s, local %s:%s, server %s:%s, ip version %s:%s\n", rip, rp, cip, cp, lip,lp, sip, sp, sipv, cipv)

}}

FortiADC version: V5.0

Used in events:

All event except VS_LISTENER_BIND

IP:server_addr()

Returns the IP address of the server in backend.

Syntax

sip=IP:server_addr()

Arguments: N/A

Examples:

Please refer to IP:client_addr() example.

FortiADC version: V5.0

Used in events:

Server-side event(include HTTP_RESPONSE/HTTP_DATA_RESPONSE/…)

IP:local_addr()

For frontend, returns the IP address of the virtual server that client is connected to. For backend, returns the incoming interface IP address of return packet.

Syntax

sip=IP:local_addr()

Arguments: N/A

Examples:

Please refer to IP:client_addr() example.

FortiADC version: V5.0

Used in events:

All events except VS_LISTENER_BIND / SERVER_BEFORE_CONNECT

IP:remote_addr()

Returns the IP address of the host on the far end of the connection.

Syntax

sip=IP:remote_addr()

Arguments: N/A

Examples:

Please refer to IP:client_addr() example.

FortiADC version: V5.0

Used in events:

All events except VS_LISTENER_BIND / SERVER_BEFORE_CONNECT

IP:client_port()

Returns the local port number. In frontend, local port is virtual server port. In backend, local port is gateway's port which used to connect.

Syntax

cp=IP:client_port()

Arguments: N/A

Examples:

Please refer to IP:client_addr() example.

FortiADC version: V5.0

Used in events:

All event except VS_LISTENER_BIND

IP:server_port()

Returns the server port number. It is a real server port.

Syntax

sp=IP:server_port()

Arguments: N/A

Examples:

Please refer to IP:client_addr() example.

FortiADC version: V5.0

Used in events:

Server-side event(include HTTP_RESPONSE/HTTP_DATA_RESPONSE/…)

IP:local_port()

Returns the local port number. In frontend, local port is virtual server port. In backend, local port is gateway's port which used to connect.

Syntax

sp=IP:local_port()

Arguments: N/A

Examples:

Please refer to IP:client_addr() example.

FortiADC version: V5.0

Used in events:

All events except VS_LISTENER_BIND / SERVER_BEFORE_CONNECT

IP:remote_port()

Returns the remote port number. In frontend, remote_port is client port. In backend, remote_port is real server port.

Syntax

rp=IP:remote_port()

Arguments: N/A

Examples:

Please refer to IP:client_addr() example.

FortiADC version: V5.0

Used in events:

All events except VS_LISTENER_BIND / SERVER_BEFORE_CONNECT

IP:client_ip_ver()

Returns the current client ip version number of the connection, either 4 or 6.

Syntax

cv=IP:client_ip_ver ()

Arguments: N/A

Examples:

Please refer to IP:client_addr() example.

FortiADC version: V5.0

Used in events:

All events except VS_LISTENER_BIND

IP:server_ip_ver()

Returns the current server ip version number of the connection, either 4 or 6.

Syntax

cv=IP:server_ip_ver ()

Arguments: N/A

Examples:

Please refer to IP:client_addr() example.

FortiADC version: V5.0

Used in events:

server-side event

IP commands

IP:Client_addr()

Returns the client IP address of a connection; for frontend it will return source address, while for back end, it will return destination address.

Syntax

cip=IP:client_addr()

Arguments: N/A

Examples:

when SERVERSSL_HANDSHAKE {

cip=IP:client_addr()

lip=IP:local_addr()

sip=IP:server_addr()

rip=IP:remote_addr()

cp=IP:client_port()

lp=IP:local_port()

sp=IP:server_port()

rp=IP:remote_port()

sipv=IP:server_ip_ver();

cipv=IP:client_ip_ver();

debug("in server ssl with remote addr %s:%s client %s:%s, local %s:%s, server %s:%s, ip version %s:%s\n", rip, rp, cip, cp, lip,lp, sip, sp, sipv, cipv)

}}

FortiADC version: V5.0

Used in events:

All event except VS_LISTENER_BIND

IP:server_addr()

Returns the IP address of the server in backend.

Syntax

sip=IP:server_addr()

Arguments: N/A

Examples:

Please refer to IP:client_addr() example.

FortiADC version: V5.0

Used in events:

Server-side event(include HTTP_RESPONSE/HTTP_DATA_RESPONSE/…)

IP:local_addr()

For frontend, returns the IP address of the virtual server that client is connected to. For backend, returns the incoming interface IP address of return packet.

Syntax

sip=IP:local_addr()

Arguments: N/A

Examples:

Please refer to IP:client_addr() example.

FortiADC version: V5.0

Used in events:

All events except VS_LISTENER_BIND / SERVER_BEFORE_CONNECT

IP:remote_addr()

Returns the IP address of the host on the far end of the connection.

Syntax

sip=IP:remote_addr()

Arguments: N/A

Examples:

Please refer to IP:client_addr() example.

FortiADC version: V5.0

Used in events:

All events except VS_LISTENER_BIND / SERVER_BEFORE_CONNECT

IP:client_port()

Returns the local port number. In frontend, local port is virtual server port. In backend, local port is gateway's port which used to connect.

Syntax

cp=IP:client_port()

Arguments: N/A

Examples:

Please refer to IP:client_addr() example.

FortiADC version: V5.0

Used in events:

All event except VS_LISTENER_BIND

IP:server_port()

Returns the server port number. It is a real server port.

Syntax

sp=IP:server_port()

Arguments: N/A

Examples:

Please refer to IP:client_addr() example.

FortiADC version: V5.0

Used in events:

Server-side event(include HTTP_RESPONSE/HTTP_DATA_RESPONSE/…)

IP:local_port()

Returns the local port number. In frontend, local port is virtual server port. In backend, local port is gateway's port which used to connect.

Syntax

sp=IP:local_port()

Arguments: N/A

Examples:

Please refer to IP:client_addr() example.

FortiADC version: V5.0

Used in events:

All events except VS_LISTENER_BIND / SERVER_BEFORE_CONNECT

IP:remote_port()

Returns the remote port number. In frontend, remote_port is client port. In backend, remote_port is real server port.

Syntax

rp=IP:remote_port()

Arguments: N/A

Examples:

Please refer to IP:client_addr() example.

FortiADC version: V5.0

Used in events:

All events except VS_LISTENER_BIND / SERVER_BEFORE_CONNECT

IP:client_ip_ver()

Returns the current client ip version number of the connection, either 4 or 6.

Syntax

cv=IP:client_ip_ver ()

Arguments: N/A

Examples:

Please refer to IP:client_addr() example.

FortiADC version: V5.0

Used in events:

All events except VS_LISTENER_BIND

IP:server_ip_ver()

Returns the current server ip version number of the connection, either 4 or 6.

Syntax

cv=IP:server_ip_ver ()

Arguments: N/A

Examples:

Please refer to IP:client_addr() example.

FortiADC version: V5.0

Used in events:

server-side event