频道栏目
首页 > 资讯 > 路由器 > 正文

通过ping、traceroute、tcpd困扰已久的网络问题终于解决了

17-08-31        来源:[db:作者]  
收藏   我要投稿

背景介绍
16、87和111都是虚拟机只有一个IP,3是物理机有两个IP分别为172.16.15.3和172.16.15.67
网段分为172.16.15.0~172.16.15.63(业务网)、172.16.15.64~172.16.15.127(管理网),两个网段之间是联通的,
业务网的网关为172.16.15.62,管理网的网关为172.16.15.126
172.16.15.87路由为

Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
default         172.16.15.126   0.0.0.0         UG    0      0        0 eth0
172.16.15.64    *               255.255.255.192 U     0      0        0 eth0

172.16.15.3路由为

[root@sugon03 ~]# route
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
default         172.16.15.62    0.0.0.0         UG    0      0        0 br1
172.16.15.0     0.0.0.0         255.255.255.192 U     0      0        0 br1
172.16.15.64    0.0.0.0         255.255.255.192 U     0      0        0 enp4s0f1
87可以ping通16、111、不能ping通3
ping16走的是路由,具体如下
[docker@pcopusrw01 /opt/apache-tomcat-8.5.9]#traceroute 172.16.15.15
traceroute to 172.16.15.15 (172.16.15.15), 30 hops max, 60 byte packets
1  172.16.15.124 (172.16.15.124)  13.747 ms  14.119 ms  14.536 ms
2  172.16.15.15 (172.16.15.15)  0.963 ms  1.101 ms  1.218 ms
ping111因为在同一个网段,不走路由,直接点对点 ping 3走的也是路由(3上面的路由配置如下),但是ping包到达3的时候,却没有返回相应的包给87,因为3发现87是64网段的,因此发现可以直接通过64这个网段直接回包给87,而64这个网段对应的网卡ip为67,因此实际会给87的包是由67发的,而ping的原理是必须来源走同一个ip,现在是87请求的是3,而回的却是67,自然就被87把回的包给扔了,当做不可达
[root@sugon03 ~]# route
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
default         172.16.15.62    0.0.0.0         UG    0      0        0 br1
172.16.15.0     0.0.0.0         255.255.255.192 U     0      0        0 br1
172.16.15.64    0.0.0.0         255.255.255.192 U     0      0        0 enp4s0f1

修改87的路由配置:

Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
default         172.16.15.126   0.0.0.0         UG    0      0        0 eth0
172.16.15.0    *               255.255.255.192 U     0      0        0 eth0
172.16.15.64    *               255.255.255.192 U     0      0        0 eth0
87可以ping通3、111、不能ping通16
ping3走的是172.16.15.0(有个疑问,这是同一个网段还是路由) ping111因为在同一个网段,不走路由,直接点对点 ping16
还要想想
相关TAG标签
上一篇:Centos7安装持续集成工具Jenkins
下一篇:metasploit连接postgresql数据库 - execute
相关文章
图文推荐

关于我们 | 联系我们 | 广告服务 | 投资合作 | 版权申明 | 在线帮助 | 网站地图 | 作品发布 | Vip技术培训 | 举报中心

版权所有: 红黑联盟--致力于做实用的IT技术学习网站