概述
SSH访问不了172.20.70.240原因是第一个路由不是172.20.70.1
[root@sshbridge ~]# route -n
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
0.0.0.0 192.168.56.1 0.0.0.0 UG 100 0 0 enp0s8
0.0.0.0 172.20.70.1 0.0.0.0 UG 101 0 0 enp0s3
172.20.70.0 0.0.0.0 255.255.255.0 U 100 0 0 enp0s3
192.168.56.0 0.0.0.0 255.255.255.0 U 100 0 0 enp0s8
解决方法:停掉 enp0s8 再启动 enp0s8
[root@sshbridge ~]# ifdown enp0s8
Device 'enp0s8' successfully disconnected.
[root@sshbridge ~]# ifup enp0s8
Connection successfully activated (D-Bus active path: /org/freedesktop/NetworkManager/ActiveConnection/5)
[root@sshbridge ~]# route -n
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
0.0.0.0 172.20.70.1 0.0.0.0 UG 100 0 0 enp0s3
0.0.0.0 192.168.56.1 0.0.0.0 UG 101 0 0 enp0s8
172.20.70.0 0.0.0.0 255.255.255.0 U 100 0 0 enp0s3
192.168.56.0 0.0.0.0 255.255.255.0 U 100 0 0 enp0s8
[root@sshbridge ~]# ping www.baidu.com
PING www.a.shifen.com (14.215.177.39) 56(84) bytes of data.
64 bytes from 14.215.177.39 (14.215.177.39): icmp_seq=1 ttl=50 time=6.81 ms
64 bytes from 14.215.177.39 (14.215.177.39): icmp_seq=2 ttl=50 time=7.51 ms
64 bytes from 14.215.177.39 (14.215.177.39): icmp_seq=3 ttl=50 time=6.50 ms
^C
--- www.a.shifen.com ping statistics ---
3 packets transmitted, 3 received, 0% packet loss, time 2003ms
rtt min/avg/max/mdev = 6.505/6.946/7.514/0.421 ms
[root@sshbridge ~]# ping 192.168.56.133
PING 192.168.56.133 (192.168.56.133) 56(84) bytes of data.
64 bytes from 192.168.56.133: icmp_seq=1 ttl=64 time=0.047 ms
64 bytes from 192.168.56.133: icmp_seq=2 ttl=64 time=0.049 ms
^C
--- 192.168.56.133 ping statistics ---
2 packets transmitted, 2 received, 0% packet loss, time 1000ms
rtt min/avg/max/mdev = 0.047/0.048/0.049/0.001 ms
[root@sshbridge ~]#
[root@sshbridge ~]#
最后
以上就是饱满向日葵为你收集整理的SSH访问不了特定网段的全部内容,希望文章能够帮你解决SSH访问不了特定网段所遇到的程序开发问题。
如果觉得靠谱客网站的内容还不错,欢迎将靠谱客网站推荐给程序员好友。
发表评论 取消回复