You're assuming that Windows networking stack is implemented exactly the same and with the same optimizations as the Linux networking stack. This is not necessarily true.
But if I've understood correctly, you'll first want to use netsh interface ipv4 show interfaces
to identify the number of the interface you wish to attach the route specification to. I'll use [IFnumber]
identify this number.
Then, if the system's own IP address is 91.6.6.5, then the route entry for telling that the 90.5.5.0/24 network is also directly connected through the same NIC, the syntax would be:
route add 90.5.5.0 mask 255.255.255.0 91.6.6.5 IF [IFnumber]
In other words: in the syntax of Windows route
command it is mandatory to specify the gateway IP address. But if you don't want to use a gateway, then you'll need to specify the interface's own IP address in place of the gateway, to satisfy the syntax requirements.
You can try this and see if it works. If you do route print
, it should now say the 90.5.5.0 network is "On-link" for the same interface that has the 91.6.6.5 IP address. Add a -p
option to the command to store the route persistently, if you want.
But if it doesn't work, you should recognize that this is a non-standard way to do IP networking and is not guaranteed to be successful in all implementations. It will also cause the packets sent from this system to the 90.5.5.0/24 segment to have a technically invalid source IP address; but if the systems only look at Layer-2 addressing ("sending directly to MAC"), it may work. If either end has a software firewall that has a built-in filter for invalid packets, that could easily be a showstopper for this technique.
The normal way to handle this would be to add a secondary IP address (within the 90.5.5.0/24 segment) to the network interface. Adding that IP would automatically add a similar route to the routing table, and it would ensure that there is a valid source IP address to use when sending packets to the 90.5.5.0/24 segment.