How to block external connections for an Oracle database?
The solution is really dependant on your environment.  There are numerous options, from hardware firewalls, to software firewalls, to sqlnet.ora parameters.  The first two are beyond the scope of this site.

The quickest, probably, is sqlnet.ora.

Have a look at the tcp.invited_nodes parameter:
https://docs.oracle.com/cd/E11882_01/network.112/e10835/sqlnet.htm#NETRF237

This goes hand in hand with the tcp.validnode_checking parameter:
https://docs.oracle.com/cd/E11882_01/network.112/e10835/sqlnet.htm#NETRF238