I've been trying to solve this out by myself but is nearly impossible...the thing is that I have to PCs on the same network, one is running Windows ( and the other one is running Debian ( I added a static route to the one running W (route add -p mask and I perfectly can ping a PC with IP address and viceversa from The problem comes when I try to add the same static route to the one running Debian, when I try to do it I get: root@satv:/home/satv# route add -net netmask gw SIOCADDRT: Network is unreachable Here are some useful things:


eth0      Link encap:Ethernet  HWaddr 1c:1b:0d:c0:a8:89  
          inet addr:  Bcast:  Mask:
          inet6 addr: fe80::1e1b:dff:fec0:a889/64 Scope:Link
          RX packets:2965 errors:0 dropped:165 overruns:0 frame:0
          TX packets:1389 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:234251 (228.7 KiB)  TX bytes:131929 (128.8 KiB)

lo        Link encap:Local Loopback  
          inet addr:  Mask:
          inet6 addr: ::1/128 Scope:Host
          UP LOOPBACK RUNNING  MTU:65536  Metric:1
          RX packets:2 errors:0 dropped:0 overruns:0 frame:0
          TX packets:2 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0 
          RX bytes:172 (172.0 B)  TX bytes:172 (172.0 B)

route -n

Kernel IP routing table Destination     Gateway         Genmask        Flags Metric Ref    Use Iface         UG    0      0        0 eth0   U     0      0        0 eth0

ip route list

default via dev eth0 dev eth0  proto kernel  scope link  src 

netstat -anr

Kernel IP routing table
Destination     Gateway         Genmask         Flags   MSS Window  irtt Iface         UG        0 0          0 eth0   U         0 0          0 eth0

Obviously I need to ping from and viceversa. Can anybody please helpme??? I've been working on this for days and I'm very desperate...Thanks a lot in advance.


The next hop you are trying to add in the route is not in the same subnet as the computer you are trying to configure the route in.

That is, netmask covers only addresses from to, and you have to use an address in that network for your next hop.

Maybe your Windows computer has a different netmask which also covers the network.

  • I understand perfectly what you're saying, but in Windows I'm using the same mask. The thing is that each network ( and are connected to different interfaces of my Firewall (Cisco ASA). One ASA interface has IP address and the other has The PC with IP address is connected to the second interface. The ASA is making the routing, that's why in Windows works fine. Sorry for my English, I hope you understand what tried to expalin. Any more ideas?? – gasparmenendez Jul 18 '17 at 22:09
  • Then you should use the address as the default gateway. Windows does all kinds of other odd things too, that's why it might work. – Tero Kilkanen Jul 19 '17 at 8:17
  • thanks @Tero Kilkanen, I'm already using as default gateway (please check the output of the commands in my question) but still no luck. What's driving me crazy is why it is so simple in Windows and in Debian I can't make it work. I really need to solve this issue ASAP... – gasparmenendez Jul 19 '17 at 14:42
  • @gasparmenendez The question refers, in different places, to both and being used as default gw. Can you clarify what is what and ensure that all the output (incl. the error) is actually valid for the problem at hand. What gw address is used on the Windows machine, which addresses actually exist on the interfaces of the router? – Håkan Lindqvist Jul 19 '17 at 15:12
  • sorry @Tero Kilkanen, maybe I got lost in translation...Windows machine has ip mask and gw and when I add: route add -p mask from cmd every thing works fine!! ( is the ip address of an ASA's interface). Please let me know if you need any more information – gasparmenendez Jul 19 '17 at 15:56

Something is a little bit strange about your routes, and it appears that this is exactly what the error message reflects.

Ie, I would think that SIOCADDRT: Network is unreachable is specifically about the gateway address, and how there is no route (link local) that can reach that address.

Is the network actually supposed to be a /23 (, ie rather than the configured /24? Or why are machines in supposed to use something outside of their network as their gateway address?

You may very well be able to coerce route or ip route into doing the same thing that Windows route apparently did assuming they actually have the same netmask (implicitly pretend that there is a route saying that is link local) or if not, just add this route first, but to me it seems that you may want to address the more fundamental oddness directly.

  • hi @Håkan Lindqvist, I forgot to mention that both network are connected to different Firewall interfaces, that's why there should be communication between them and that's why I think is working in Windows. The problem is with Debian, don't know why. What do you think?? – gasparmenendez Jul 18 '17 at 22:21
  • @gasparmenendez Based on what you wrote in the question, the error seems to make sense (as I outlined in my answer). Can you elaborate on why you think it should work and what happens if you add the route that would be required for the setup to really make sense? – Håkan Lindqvist Jul 19 '17 at 14:55
  • hi @Håkan Lindqvist, sorry but what do you mean with add route that would be required for the setup to really make sense? what's that route??? About why I think it should work is very simple: it works fine and simple in Windows PC and in Debian doesn't.... so I think I'm missing something in Debian. Please let me know if you need any more information. Thanks!! – gasparmenendez Jul 19 '17 at 15:46
  • @gasparmenendez That was based on how it says as the gateway address (which you have no route to reach), but if that is incorrect (as indicated in other comments?) it may be irrelevant. – Håkan Lindqvist Jul 19 '17 at 19:02
  • already solved my friend @Håkan Lindqvist, the gw for Windows is different from gw for Debian, don't ask me why cause I don't have a clue...For Debian the gw is the vlan's ip address ( Anyway the problem is solved. Thank you so much for your help!!!! – gasparmenendez Jul 19 '17 at 20:37

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.