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:
- db2 catalog tcpip node <hostname> remote 127.0.0.1 server <port>
- db2 catalog db sample as samptemp
- db2 uncatalog db sample
- db2 catalog db samptemp as sample at node <hostname>
- 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":"BU058","label":"IBM Infrastructure w\/TPS"},"Product":{"code":"SSEPGG","label":"Db2 for Linux, UNIX and Windows"},"Component":"","Platform":[{"code":"PF025","label":"Platform Independent"}],"Version":"","Edition":"","Line of Business":{"code":"LOB10","label":"Data and AI"}}]
UID
ibm11140862