Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
987 views
in Technique[技术] by (71.8m points)

virtual machine - Virtualbox - Oracle Network Adapter could not establish the connection

I have just installed Virtualbox and executed official Oracle Image (Database App Development VM).

  1. I can of course open SQL developer within the guest OS and connect to DB.
  2. I can connect to DB from host OS with SQL Developer.

I set up the network interface to bridged and:

  1. I can also connect to DB from other (than host) computer within my home network.

I also have static external IP, I did the port forwarding and appropriate firewall rules on router as well as I turned of Windows Firewall on host OS. But when I try to connect from outside my local network, I get the error Oracle Network Adapter could not establish the connection - even when I try to connect from host OS using external IP. Below I attach my Listener.ora contents. I checked that oracle listener is running. I run out of ideas, anyone can help?

SID_LIST_LISTENER =
  (SID_LIST =
    (SID_DESC =
      (GLOBAL_DBNAME = orclcdb)
      (SID_NAME = orclcdb)
      (ORACLE_HOME = /u01/app/oracle/product/version/db_1)
    )
  )

LISTENER =
  (DESCRIPTION_LIST =
    (DESCRIPTION =
      (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1))
      (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.1.56)(PORT = 1521))
    )
  )

#HOSTNAME by pluggable not working rstriction or configuration error.
DEFAULT_SERVICE_LISTENER = (orclcdb)
question from:https://stackoverflow.com/questions/65919934/virtualbox-oracle-network-adapter-could-not-establish-the-connection

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

"But when I try to connect from outside my local network"

That's because your home network is not "routable". Read more [here][1], but I'll quote the salient part:

Class C: Any address that starts with 192.168

All routers will discard any traffic to a private network address. That means that it is entirely private. Anything you send on your own network will never get out to the Internet. Anything that comes in from the Internet will not be sent onto your local network.

Personally, I would not want it to be any other way. Why do you think you need to reach this vm from outside your home network? [1]: https://www.quora.com/What-does-192-mean-in-an-IP-addresses-and-What-is-it


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...