SIOCADDRT: Network is unreachable when trying to add route

3.5k views Asked by At

Here is the ifconfig from Ubuntu:

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,BROADCAST,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,BROADCAST,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,BROADCAST,RUNNING,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,BROADCAST,RUNNING,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

Here is the ipconfig from Windows (with 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  . : 

When I am on the Windows machine, I can ping the Ubuntu machine:

$ 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

But I cannot ping the Windows machine from the Ubuntu machine:

$ 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

I attempted some route commands on the Ubuntu machine, but had no success:

$ 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

Here is the route table on 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

Here is the route table on 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

What route command do I need so the Ubuntu can reach the Windows machine?

0

There are 0 answers