SIOCADDRT:尝试添加路由时网络无法访问

如何解决SIOCADDRT:尝试添加路由时网络无法访问

这是来自 Ubuntu 的 ifconfig:

eno1: flags=4099<UP,BROADCAST,MULTICAST>  mtu 1500
        ether ac:1f:6b:3c:60:c4  txqueuelen 1000  (Ethernet)
        RX packets 0  bytes 0 (0.0 B)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 0  bytes 0 (0.0 B)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

eno2: flags=4163<UP,RUNNING,MULTICAST>  mtu 1500
        inet 10.134.50.124  netmask 255.255.255.0  broadcast 10.134.50.255
        inet6 fe80::c94e:c0f0:2149:ce10  prefixlen 64  scopeid 0x20<link>
        ether ac:1f:6b:3c:60:c5  txqueuelen 1000  (Ethernet)
        RX packets 116239544  bytes 98775856318 (98.7 GB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 38366240  bytes 7250711499 (7.2 GB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

lo: flags=73<UP,LOOPBACK,RUNNING>  mtu 65536
        inet 127.0.0.1  netmask 255.0.0.0
        inet6 ::1  prefixlen 128  scopeid 0x10<host>
        loop  txqueuelen 1000  (Local Loopback)
        RX packets 1094335  bytes 262320880 (262.3 MB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 1094335  bytes 262320880 (262.3 MB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

virbr0: flags=4099<UP,MULTICAST>  mtu 1500
        inet 192.168.122.1  netmask 255.255.255.0  broadcast 192.168.122.255
        ether 52:54:00:f9:60:b6  txqueuelen 1000  (Ethernet)
        RX packets 0  bytes 0 (0.0 B)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 0  bytes 0 (0.0 B)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

vmnet1: flags=4163<UP,MULTICAST>  mtu 1500
        inet 172.16.212.1  netmask 255.255.255.0  broadcast 172.16.212.255
        inet6 fe80::54af:eff1:f932:d2b8  prefixlen 64  scopeid 0x20<link>
        ether 00:50:56:c0:00:01  txqueuelen 1000  (Ethernet)
        RX packets 4002  bytes 0 (0.0 B)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 151408  bytes 0 (0.0 B)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

vmnet8: flags=4163<UP,MULTICAST>  mtu 1500
        inet 192.168.36.1  netmask 255.255.255.0  broadcast 192.168.36.255
        inet6 fe80::bba6:8b54:ddcf:8499  prefixlen 64  scopeid 0x20<link>
        ether 00:50:56:c0:00:08  txqueuelen 1000  (Ethernet)
        RX packets 4214  bytes 0 (0.0 B)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 152463  bytes 0 (0.0 B)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

这是来自 Windows 的 ipconfig(使用 Cygwin):

Windows IP Configuration


Ethernet adapter Ethernet:

   Media State . . . . . . . . . . . : Media disconnected
   Connection-specific DNS Suffix  . : cwnow.local

Ethernet adapter VirtualBox Host-Only Network:

   Connection-specific DNS Suffix  . : 
   Link-local IPv6 Address . . . . . : fe80::d8fb:7a9d:b018:8399%20
   IPv4 Address. . . . . . . . . . . : 192.168.56.1
   Subnet Mask . . . . . . . . . . . : 255.255.255.0
   Default Gateway . . . . . . . . . : 

Ethernet adapter Npcap Loopback Adapter:

   Connection-specific DNS Suffix  . : 
   Link-local IPv6 Address . . . . . : fe80::927:546c:aa9d:f57e%19
   Autoconfiguration IPv4 Address. . : 169.254.245.126
   Subnet Mask . . . . . . . . . . . : 255.255.0.0
   Default Gateway . . . . . . . . . : 

Wireless LAN adapter Local Area Connection* 1:

   Media State . . . . . . . . . . . : Media disconnected
   Connection-specific DNS Suffix  . : 

Wireless LAN adapter Local Area Connection* 3:

   Media State . . . . . . . . . . . : Media disconnected
   Connection-specific DNS Suffix  . : 

Ethernet adapter VMware Network Adapter VMnet1:

   Connection-specific DNS Suffix  . : 
   Link-local IPv6 Address . . . . . : fe80::a941:328d:af54:6a14%12
   IPv4 Address. . . . . . . . . . . : 192.168.146.1
   Subnet Mask . . . . . . . . . . . : 255.255.255.0
   Default Gateway . . . . . . . . . : 

Ethernet adapter VMware Network Adapter VMnet8:

   Connection-specific DNS Suffix  . : 
   Link-local IPv6 Address . . . . . : fe80::9ed:bfc8:373c:3ce6%2
   IPv4 Address. . . . . . . . . . . : 192.168.195.1
   Subnet Mask . . . . . . . . . . . : 255.255.255.0
   Default Gateway . . . . . . . . . : 

Wireless LAN adapter Wi-Fi:

   Connection-specific DNS Suffix  . : 
   Link-local IPv6 Address . . . . . : fe80::fcfd:d9cc:e5ba:3c31%13
   IPv4 Address. . . . . . . . . . . : 10.134.52.220
   Subnet Mask . . . . . . . . . . . : 255.255.255.0
   Default Gateway . . . . . . . . . : 10.134.52.196

Ethernet adapter Bluetooth Network Connection:

   Media State . . . . . . . . . . . : Media disconnected
   Connection-specific DNS Suffix  . : 

当我在 Windows 机器上时,我可以 ping Ubuntu 机器:

$ ping -c 3 10.134.50.124
PING 10.134.50.124 (10.134.50.124): 56 data bytes
64 bytes from 10.134.50.124: icmp_seq=0 ttl=62 time=3.011 ms
64 bytes from 10.134.50.124: icmp_seq=1 ttl=62 time=4.598 ms
64 bytes from 10.134.50.124: icmp_seq=2 ttl=62 time=2.967 ms
--- 10.134.50.124 ping statistics ---
3 packets transmitted,3 packets received,0% packet loss
round-trip min/avg/max/stddev = 2.967/3.525/4.598/0.759 ms

但我无法从 Ubuntu 机器 ping Windows 机器:

$ ping -c 3 10.134.52.220
PING 10.134.52.220 (10.134.52.220) 56(84) bytes of data.

--- 10.134.52.220 ping statistics ---
3 packets transmitted,0 received,100% packet loss,time 2080ms

我在 Ubuntu 机器上尝试了一些 route 命令,但没有成功:

$ route add -host 10.134.52.220 gw 10.134.52.196
SIOCADDRT: Operation not permitted
$ route add -host 10.134.52.220 gw 10.134.52.196 netmask 255.255.248.0
route: netmask 000007ff doesn't make sense with host route
$ route add -host 10.134.52.220/24 gw 10.134.52.196
route: netmask 000000ff doesn't make sense with host route
$ route add -host 10.134.52.220/21 gw 10.134.52.196
route: netmask 000007ff doesn't make sense with host route

这是 Ubuntu 上的路由表:

$ netstat -ar
Kernel IP routing table
Destination     Gateway         Genmask         Flags   MSS Window  irtt Iface
default         _gateway        0.0.0.0         UG        0 0          0 eno2
10.134.50.0     0.0.0.0         255.255.255.0   U         0 0          0 eno2
10.134.52.220   _gateway        255.255.255.255 UGH       0 0          0 eno2
link-local      0.0.0.0         255.255.0.0     U         0 0          0 eno2
172.16.212.0    0.0.0.0         255.255.255.0   U         0 0          0 vmnet1
192.168.36.0    0.0.0.0         255.255.255.0   U         0 0          0 vmnet8
192.168.122.0   0.0.0.0         255.255.255.0   U         0 0          0 virbr0

这是 Windows 上的路由表:

$ netstat -ar
===========================================================================
Interface List
 23...8c 16 45 26 ae 98 ......Intel(R) Ethernet Connection (5) I219-LM
 20...0a 00 27 00 00 14 ......VirtualBox Host-Only Ethernet Adapter
 19...02 00 4c 4f 4f 50 ......Npcap Loopback Adapter
  4...76 e5 f9 dd 66 34 ......Microsoft Wi-Fi Direct Virtual Adapter
  7...74 e5 f9 dd 66 35 ......Microsoft Wi-Fi Direct Virtual Adapter #2
 12...00 50 56 c0 00 01 ......VMware Virtual Ethernet Adapter for VMnet1
  2...00 50 56 c0 00 08 ......VMware Virtual Ethernet Adapter for VMnet8
 13...74 e5 f9 dd 66 34 ......Intel(R) Dual Band Wireless-AC 8265
 11...74 e5 f9 dd 66 38 ......Bluetooth Device (Personal Area Network)
  1...........................Software Loopback Interface 1
===========================================================================

IPv4 Route Table
===========================================================================
Active Routes:
Network Destination        Netmask          Gateway       Interface  Metric
          0.0.0.0          0.0.0.0    10.134.52.196    10.134.52.220     50
      10.134.52.0    255.255.255.0         On-link     10.134.52.220    306
    10.134.52.220  255.255.255.255         On-link     10.134.52.220    306
    10.134.52.255  255.255.255.255         On-link     10.134.52.220    306
        127.0.0.0        255.0.0.0         On-link         127.0.0.1    331
        127.0.0.1  255.255.255.255         On-link         127.0.0.1    331
  127.255.255.255  255.255.255.255         On-link         127.0.0.1    331
      169.254.0.0      255.255.0.0         On-link   169.254.245.126    281
  169.254.245.126  255.255.255.255         On-link   169.254.245.126    281
  169.254.255.255  255.255.255.255         On-link   169.254.245.126    281
     192.168.56.0    255.255.255.0         On-link      192.168.56.1    281
     192.168.56.1  255.255.255.255         On-link      192.168.56.1    281
   192.168.56.255  255.255.255.255         On-link      192.168.56.1    281
    192.168.146.0    255.255.255.0         On-link     192.168.146.1    291
    192.168.146.1  255.255.255.255         On-link     192.168.146.1    291
  192.168.146.255  255.255.255.255         On-link     192.168.146.1    291
    192.168.195.0    255.255.255.0         On-link     192.168.195.1    291
    192.168.195.1  255.255.255.255         On-link     192.168.195.1    291
  192.168.195.255  255.255.255.255         On-link     192.168.195.1    291
        224.0.0.0        240.0.0.0         On-link         127.0.0.1    331
        224.0.0.0        240.0.0.0         On-link      192.168.56.1    281
        224.0.0.0        240.0.0.0         On-link     192.168.146.1    291
        224.0.0.0        240.0.0.0         On-link     192.168.195.1    291
        224.0.0.0        240.0.0.0         On-link   169.254.245.126    281
        224.0.0.0        240.0.0.0         On-link     10.134.52.220    306
  255.255.255.255  255.255.255.255         On-link         127.0.0.1    331
  255.255.255.255  255.255.255.255         On-link      192.168.56.1    281
  255.255.255.255  255.255.255.255         On-link     192.168.146.1    291
  255.255.255.255  255.255.255.255         On-link     192.168.195.1    291
  255.255.255.255  255.255.255.255         On-link   169.254.245.126    281
  255.255.255.255  255.255.255.255         On-link     10.134.52.220    306
===========================================================================
Persistent Routes:
  None

IPv6 Route Table
===========================================================================
Active Routes:
 If Metric Network Destination      Gateway
  1    331 ::1/128                  On-link
 20    281 fe80::/64                On-link
 12    291 fe80::/64                On-link
  2    291 fe80::/64                On-link
 19    281 fe80::/64                On-link
 13    306 fe80::/64                On-link
 19    281 fe80::927:546c:aa9d:f57e/128
                                    On-link
  2    291 fe80::9ed:bfc8:373c:3ce6/128
                                    On-link
 12    291 fe80::a941:328d:af54:6a14/128
                                    On-link
 20    281 fe80::d8fb:7a9d:b018:8399/128
                                    On-link
 13    306 fe80::fcfd:d9cc:e5ba:3c31/128
                                    On-link
  1    331 ff00::/8                 On-link
 20    281 ff00::/8                 On-link
 12    291 ff00::/8                 On-link
  2    291 ff00::/8                 On-link
 19    281 ff00::/8                 On-link
 13    306 ff00::/8                 On-link
===========================================================================
Persistent Routes:
  None

我需要什么路由命令才能让 Ubuntu 访问 Windows 机器?

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。

相关推荐


依赖报错 idea导入项目后依赖报错,解决方案:https://blog.csdn.net/weixin_42420249/article/details/81191861 依赖版本报错:更换其他版本 无法下载依赖可参考:https://blog.csdn.net/weixin_42628809/a
错误1:代码生成器依赖和mybatis依赖冲突 启动项目时报错如下 2021-12-03 13:33:33.927 ERROR 7228 [ main] o.s.b.d.LoggingFailureAnalysisReporter : *************************** APPL
错误1:gradle项目控制台输出为乱码 # 解决方案:https://blog.csdn.net/weixin_43501566/article/details/112482302 # 在gradle-wrapper.properties 添加以下内容 org.gradle.jvmargs=-Df
错误还原:在查询的过程中,传入的workType为0时,该条件不起作用 &lt;select id=&quot;xxx&quot;&gt; SELECT di.id, di.name, di.work_type, di.updated... &lt;where&gt; &lt;if test=&qu
报错如下,gcc版本太低 ^ server.c:5346:31: 错误:‘struct redisServer’没有名为‘server_cpulist’的成员 redisSetCpuAffinity(server.server_cpulist); ^ server.c: 在函数‘hasActiveC
解决方案1 1、改项目中.idea/workspace.xml配置文件,增加dynamic.classpath参数 2、搜索PropertiesComponent,添加如下 &lt;property name=&quot;dynamic.classpath&quot; value=&quot;tru
删除根组件app.vue中的默认代码后报错:Module Error (from ./node_modules/eslint-loader/index.js): 解决方案:关闭ESlint代码检测,在项目根目录创建vue.config.js,在文件中添加 module.exports = { lin
查看spark默认的python版本 [root@master day27]# pyspark /home/software/spark-2.3.4-bin-hadoop2.7/conf/spark-env.sh: line 2: /usr/local/hadoop/bin/hadoop: No s
使用本地python环境可以成功执行 import pandas as pd import matplotlib.pyplot as plt # 设置字体 plt.rcParams[&#39;font.sans-serif&#39;] = [&#39;SimHei&#39;] # 能正确显示负号 p
错误1:Request method ‘DELETE‘ not supported 错误还原:controller层有一个接口,访问该接口时报错:Request method ‘DELETE‘ not supported 错误原因:没有接收到前端传入的参数,修改为如下 参考 错误2:cannot r
错误1:启动docker镜像时报错:Error response from daemon: driver failed programming external connectivity on endpoint quirky_allen 解决方法:重启docker -&gt; systemctl r
错误1:private field ‘xxx‘ is never assigned 按Altʾnter快捷键,选择第2项 参考:https://blog.csdn.net/shi_hong_fei_hei/article/details/88814070 错误2:启动时报错,不能找到主启动类 #
报错如下,通过源不能下载,最后警告pip需升级版本 Requirement already satisfied: pip in c:\users\ychen\appdata\local\programs\python\python310\lib\site-packages (22.0.4) Coll
错误1:maven打包报错 错误还原:使用maven打包项目时报错如下 [ERROR] Failed to execute goal org.apache.maven.plugins:maven-resources-plugin:3.2.0:resources (default-resources)
错误1:服务调用时报错 服务消费者模块assess通过openFeign调用服务提供者模块hires 如下为服务提供者模块hires的控制层接口 @RestController @RequestMapping(&quot;/hires&quot;) public class FeignControl
错误1:运行项目后报如下错误 解决方案 报错2:Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.8.1:compile (default-compile) on project sb 解决方案:在pom.
参考 错误原因 过滤器或拦截器在生效时,redisTemplate还没有注入 解决方案:在注入容器时就生效 @Component //项目运行时就注入Spring容器 public class RedisBean { @Resource private RedisTemplate&lt;String
使用vite构建项目报错 C:\Users\ychen\work&gt;npm init @vitejs/app @vitejs/create-app is deprecated, use npm init vite instead C:\Users\ychen\AppData\Local\npm-