pl/sql developer通过IPV6连接oracle-阿里云开发者社区

开发者社区> 开发与运维> 正文

pl/sql developer通过IPV6连接oracle

简介: pl/sql developer通过IPV6连接oracle

背景:

在centos6上安装oracle 11gR2,配置IPV6 ,想在客户端使用pl/sql developer通过IPV6连接oracle服务器。在爬坑的过程中发现在centos7上通过IPV6连接就没有问题,centos6就不行。所以在centos6上考虑问题,突然想到centos6还有一个ip6tables防火墙的,对的,问题就出现在ip6tables上,只要添加1521端口就行了:

[root@ml ~]# vim /etc/sysconfig/ip6tables

# Firewall configuration written by system-config-firewall
# Manual customization of this file is not recommended.
*filter
:INPUT ACCEPT [0:0]
:FORWARD ACCEPT [0:0]
:OUTPUT ACCEPT [0:0]
-A INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT
-A INPUT -p ipv6-icmp -j ACCEPT
-A INPUT -i lo -j ACCEPT
-A INPUT -m state --state NEW -m tcp -p tcp --dport 1521 -j ACCEPT
-A INPUT -m state --state NEW -m udp -p udp --dport 546 -d fe80::/64 -j ACCEPT
-A INPUT -m state --state NEW -m tcp -p tcp --dport 22 -j ACCEPT
-A INPUT -j REJECT --reject-with icmp6-adm-prohibited
-A FORWARD -j REJECT --reject-with icmp6-adm-prohibited
COMMIT

[root@ml ~]# service ip6tables restart   
ip6tables: Setting chains to policy ACCEPT: filter         [  OK  ]
ip6tables: Flushing firewall rules:                        [  OK  ]
ip6tables: Unloading modules:                              [  OK  ]
ip6tables: Applying firewall rules:                        [  OK  ]
[root@ml ~]#

客户端配置:tnsnames.ora配置(同一台ipv4与ipv6地址,配置IPV4是想用来做判断)

24.128 =
  (DESCRIPTION =
    (ADDRESS_LIST =
      (ADDRESS = (PROTOCOL = TCP)(HOST = 172.16.24.128)(PORT = 1521))
    )
    (CONNECT_DATA =
      (SERVICE_NAME = dbsrv2)
    )
  )

ipv6_24.128 =
  (DESCRIPTION =
    (ADDRESS_LIST =
      (ADDRESS = (PROTOCOL = TCP)(HOST = [FEC0:0:0:0001::3])(PORT = 1521))
    )
    (CONNECT_DATA =
      (SERVICE_NAME = dbsrv2)
    )
  )

测试:

Microsoft Windows [版本 10.0.10240]
(c) 2015 Microsoft Corporation. All rights reserved.

C:\Users\ML>tnsping ipv6_24.128

TNS Ping Utility for 64-bit Windows: Version 11.2.0.1.0 - Production on 17-8月 -2018 08:56:01

Copyright (c) 1997, 2010, Oracle.  All rights reserved.

已使用的参数文件:
C:\Users\ML\Downloads\instantclient-basic-windows.x64-12.2.0.1.0\instantclient_12_2\NETWORK\ADMIN\sqlnet.ora


已使用 TNSNAMES 适配器来解析别名
尝试连接 (DESCRIPTION = (ADDRESS_LIST = (ADDRESS = (PROTOCOL = TCP)(HOST = [FEC0:0:0:0001::3])(PORT = 1521))) (CONNECT_DATA = (SERVICE_NAME = dbsrv2)))
OK (20 毫秒)

C:\Users\ML>

版权声明:本文内容由阿里云实名注册用户自发贡献,版权归原作者所有,阿里云开发者社区不拥有其著作权,亦不承担相应法律责任。具体规则请查看《阿里云开发者社区用户服务协议》和《阿里云开发者社区知识产权保护指引》。如果您发现本社区中有涉嫌抄袭的内容,填写侵权投诉表单进行举报,一经查实,本社区将立刻删除涉嫌侵权内容。

分享:
开发与运维
使用钉钉扫一扫加入圈子
+ 订阅

集结各类场景实战经验,助你开发运维畅行无忧

其他文章