码迷,mamicode.com
首页 > 其他好文 > 详细

物理机与虚拟机IP互ping通,而互ping主机名不通

时间:2015-04-05 23:19:03      阅读:302      评论:0      收藏:0      [点我收藏+]

标签:

问题描述:
虚拟机信息:
VMware-workstation 10
安装RHEL5.8操作系统、hostname:rhel201.com IP:192.168.1.201

物理机系统:windows 7
主机名:rusky-PC IP: 192.168.1.123

两者能够互相ping通对方的IP地址,但是互ping对方主机名失败。

处理方法:
1、虚拟机linux系统中编辑如下文件
[root@rhel201 ~]# vi /etc/hosts

# Do not remove the following line, or various programs
# that require network functionality will fail.
127.0.0.1 localhost.localdomain localhost
192.168.1.201 rhel201.com rhel201
#加上物理机的IP和主机名对应关系
192.168.1.123 rusky-PC
----------------------------
[root@rhel201 ~]# cat /etc/resolv.conf --该文件内容如下,应该跟这个文件没影响。
search localdomain

2、windows7系统修改如下文件(添加linux系统的主机名与IP对应关系)
C:\Windows\System32\drivers\etc
192.168.1.201 rhel201.com


测试结果:
从虚拟机中可ping通物理的IP和主机名:

[root@rhel201 ~]# ping 192.168.1.123
PING 192.168.1.123 (192.168.1.123) 56(84) bytes of data.
64 bytes from 192.168.1.123: icmp_seq=1 ttl=128 time=0.213 ms
64 bytes from 192.168.1.123: icmp_seq=2 ttl=128 time=0.138 ms

--- 192.168.1.123 ping statistics ---
2 packets transmitted, 2 received, 0% packet loss, time 1001ms
rtt min/avg/max/mdev = 0.138/0.175/0.213/0.039 ms
[root@rhel201 ~]# ping rusky-pc
PING rusky-PC (192.168.1.123) 56(84) bytes of data.
64 bytes from rusky-PC (192.168.1.123): icmp_seq=1 ttl=128 time=0.125 ms
64 bytes from rusky-PC (192.168.1.123): icmp_seq=2 ttl=128 time=0.107 ms
^C^H64 bytes from rusky-PC (192.168.1.123): icmp_seq=3 ttl=128 time=0.122 ms

--- rusky-PC ping statistics ---
3 packets transmitted, 3 received, 0% packet loss, time 2000ms
rtt min/avg/max/mdev = 0.107/0.118/0.125/0.007 ms

从物理机可拼通虚拟机的IP和主机名

C:\Users\Administrator>ping rhel201.com

正在 Ping rhel201.com [192.168.1.201] 具有 32 字节的数据:
来自 192.168.1.201 的回复: 字节=32 时间<1ms TTL=64
来自 192.168.1.201 的回复: 字节=32 时间<1ms TTL=64

192.168.1.201 的 Ping 统计信息:
数据包: 已发送 = 2,已接收 = 2,丢失 = 0 (0% 丢失),
往返行程的估计时间(以毫秒为单位):
最短 = 0ms,最长 = 0ms,平均 = 0ms

C:\Users\Administrator>ping 192.168.1.201

正在 Ping 192.168.1.201 具有 32 字节的数据:
来自 192.168.1.201 的回复: 字节=32 时间<1ms TTL=64
来自 192.168.1.201 的回复: 字节=32 时间<1ms TTL=64
来自 192.168.1.201 的回复: 字节=32 时间<1ms TTL=64
来自 192.168.1.201 的回复: 字节=32 时间<1ms TTL=64

192.168.1.201 的 Ping 统计信息:
数据包: 已发送 = 4,已接收 = 4,丢失 = 0 (0% 丢失),
往返行程的估计时间(以毫秒为单位):
最短 = 0ms,最长 = 0ms,平均 = 0ms

==================================
关于上述问题的影响:
在服务端VMware-linux系统下安装ORACLE11g数据库,windows下安装oracle11g客户端,但是从客户端使用SQLPLUS无法连接到服务端。
1、远程客户端口sqlplus无法连接到数据库
远程客户端(指windows7系统),在CMD下tnsping 201instanceName不通,tnsping rhel201.com,tnsping 192.168.1.201也不通。SQLPLUS也无法连接数据库实例。

2、远程客机从浏览器无法访问EM管理器
在linux系统中使用自带的Firefox浏览器可正常访问EM管理器,但是在客户端通过:https://192.168.1.201
1158/em或是https://rhel201.com:1158/em这两种方式均提示无法显示该网页。
客户端:telnet 192.168.1.201 1158不通。

当主机名通互相ping通后,EM及sqlplul连接正常。

另外建议访问EM使用fireFox浏览器,因为在使用IE或是360访问EM的过程中经常崩溃。

物理机与虚拟机IP互ping通,而互ping主机名不通

标签:

原文地址:http://www.cnblogs.com/rusking/p/4394868.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!