IBM Support

How to configure your local DB2 database connections to use TCP-IP by default

Technical Blog Post


Abstract

How to configure your local DB2 database connections to use TCP-IP by default

Body

Do you need to force applications to use the TCP-IP loopback connection to connect to your local DB2 database?

The steps to do this are quite simple:

  1. db2 catalog tcpip node <hostname> remote 127.0.0.1 server <port>
  2. db2 catalog db sample as samptemp
  3. db2 uncatalog db sample
  4. db2 catalog db samptemp as sample at node <hostname>
  5. db2 terminate

<hostname> - This is your local system hostname

<port> - This is an unused network port for DB2 to use

Now when you connect to DB2 from the local host it will use the TCP-IP loopback interface:
db2 connect to sample user <user> using <password> 

[{"Business Unit":{"code":"BU029","label":"Data and AI"}, "Product":{"code":"SSEPGG","label":"DB2 for Linux- UNIX and Windows"},"Component":"","Platform":[{"code":"PF025","label":"Platform Independent"}],"Version":"","Edition":""}]

UID

ibm11140862