TNS-12535: TNS:operation timed out

SURESH KUMAR, SABESH 45 Reputation points
2024-01-11T21:59:33.09+00:00

We have a Azure VM (Red hat linux 8.9) where Oracle DB build on it. When we do tnsping within the azure server its working fine. But when i pinged on my local network its throwing error as "TNS-12535: TNS:operation timed out". We have already enable the 1521 port on the network setting. But still I'm not able to connect it. Could you please help me on it.

Azure Virtual Network
Azure Virtual Network
An Azure networking service that is used to provision private networks and optionally to connect to on-premises datacenters.
2,778 questions
{count} votes

Accepted answer
  1. ChaitanyaNaykodi-MSFT 27,481 Reputation points Microsoft Employee Moderator
    2024-01-13T00:49:58.5833333+00:00

    @SURESH KUMAR, SABESH

    Thank you for getting back and sharing additional details here.

    I understand you tried the IP Flow verify test and you received access denied error message.

    A network security group contains security rules that allow or deny inbound network traffic to, or outbound network traffic from, several types of Azure resources. For each rule, you can specify source and destination, port, and protocol.

    IP flow verify returns Access denied and the name of the security rule that denies or allows the traffic, and the network security group with a link to it so you can edit it if you need to.

    User's image If you received access denied error with a link to the NSG blocking this connectivity (as per the image shown above), you can check if any particular Inbound or Outbound rule is blocking the connectivity in this NSG.

    If IP Flow Verify did not provide a link to any NSG then a default security rule is denying the traffic. For more information, see Default security rules.

    As the NSG implements DenyAllInbound and DenyAllOutBound rules then you need to add both inbound and outbound rules to allow communication for port 1521 from your local machine's Public IP.

    On your network in Azure please check the if any NSG is associated with VM's NIC and VM's subnet and add a rule as shown below.

    For Inbound Rules:

    Source IP : This should be your Local Machine's Public IP

    Destination IP: Your Virtual Machine's Public IP

    Destination Port: 1521

    For Outbound rules:

    Source IP : Your Virtual Machine's Public IP

    Destination IP: This should be your Local Machine's Public IP

    Source Port: 1521

    You can use the image below as reference

    User's image

    Reference: https://learn.microsoft.com/en-us/azure/virtual-network/tutorial-filter-network-traffic#create-security-rules

    Hope this helps! Please let me know if you have any additional questions. Thank you!

    ​​Please "Accept the answer" if the information helped you. This will help us and others in the community as well.

    0 comments No comments

2 additional answers

Sort by: Most helpful
  1. SURESH KUMAR, SABESH 45 Reputation points
    2024-01-24T06:14:52.7466667+00:00

    Thanks @ChaitanyaNaykodi-MSFT . I have found another issue. When i do tnsping on Azure VM goes through 1521 but when I do it on local machine, it goes through 1522 and throws time out error. Azure VM: $ tnsping t7XXXXX.db.att.com TNS Ping Utility for Linux: Version 19.0.0.0.0 - Production on 17-JAN-2024 11:35:01 Copyright (c) 1997, 2023, Oracle.  All rights reserved. Used parameter files:
    /u01/app/oracle/product/19.19.0/network/admin/sqlnet.ora  Used TNSNAMES adapter to resolve the alias
    Attempting to contact (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP) (HOST = t7XXXX.az.3pc.XXX.com) (PORT = 1521)) (CONNECT_DATA = (SID = t7XXXXX)))
    OK (10 msec) Local Machine CMD: C:\Users\ss>tnsping t7XXXXX.db.att.com TNS Ping Utility for 64-bit Windows: Version 19.0.0.0.0 - Production on 17-JAN-2024 10:30:19 Copyright (c) 1997, 2021, Oracle.  All rights reserved. Used parameter files: Used LDAP adapter to resolve the alias
    Attempting to contact (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=t7XXXXX.az.3pc.XXX.com)(PORT=1522))(CONNECT_DATA=(SID=t7XXXXX)))
    TNS-12535: TNS:operation timed out C:\Users\ss> Why there is a difference on the port ?

    0 comments No comments

  2. SURESH KUMAR, SABESH 45 Reputation points
    2024-01-30T03:01:01.69+00:00

    Thanks @ChaitanyaNaykodi-MSFT Any suggestion for the above issue


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.