Jump to content
Henry Olive

FB-3 Get Connected Clients IP Numbers

Recommended Posts

Good Day,

FB-3,09  Super Server

Delphi 10,3

TCP/IP

 

FB FAQ says,

If you wish to do it from SQL, you need to use Firebird 2.1 at least, and it's monitoring tables. The relevant table is MON$ATTACHMENTS which provides a lot of useful information like user name, IP address, connection state, remote process name (so you can see which application user is using), etc.
 

then i tried below Sql but i cant see any IP Adress

 

select MON$REMOTE_ADDRESS

  from MON$ATTACHMENTS

 

Above query's result is like below ( No IP Number )

 

MON$REMOTE_ADDRESS

---------------------------------------

fe80::2554:878:750b:852f%5/50222
fe80::9037:f453:60b:b6b9%5/52029 

Thank You

 

 

 

Share this post


Link to post

Thank you so much Vandrovnik

In server machine Ethernet Proporties both TCP/IPv4 and TCP/IPv6  CHECKED

If i uncheck TCP/IPv6 ( Just TCP/IPv4 checked )  then i cannot connect My App

(Rejected Remote Interface error)

 

Share this post


Link to post
Posted (edited)
19 hours ago, Henry Olive said:

If i uncheck TCP/IPv6 ( Just TCP/IPv4 checked )  then i cannot connect My App 

Not really related to the question! Check in the file firebird.conf if IPv6V6Only is not set to 1  (around line 712)

Check also AuthServer and AuthClient values (chapter around line 397) 

 

To have IP_V4 only I Found this explanation

Quote

The systemd configuration files for firebird, firebird-classic@.service & firebird-classic.socket are located in /usr/lib/systemd/system.

#cat firebird-classic.socket

[Unit]

Description=Firebird Classic Activation Socket

[Socket]

ListenStream=3050

I changed the ListenStream to

ListenStream=0.0.0.0:3050

and restarted the service and now firebird is listening on 0.0.0.0:3050 and not :::3050, which means it is listening on IPV4 protocol.


But, systemd configuration files ⁉️ I don't think you will find them (this explanation was for CENTOS 7)
I don't think changing the RemoteServicePort value to 0.0.0.0:3050 (around line 667) should be a good idea, (idea I can't check), but you can have a try


Now, according to this https://www.firebirdsql.org/file/documentation/html/en/firebirddocs/isql/firebird-isql.html#isql-connect-connection-string-url
 

Quote

TCP/IP (first tries to connect using the IPv6 protocol, if it fails, then IPv4)

So if you use INET4 to connect to your database instead of INET you will certainly have IP_V4 address in your MON$ATTACHMENTS table.
How ? Certainly 2 ways
- modifying firebird.conf   RemoteBindAddress (around line 725)  setting it to INET4 but this should be restricting I think

- by delphi code at connexion (depending on components used)

Edited by Serge_G

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×