Using the route command I want to add not a specific IP, but a range of 172.16.12.0-172.16.12.255 . I tried route add -p 172.16.80.95 172.16.12.0 The route is being added, but it does not seem that the whole range is clinging. If I add one IP, then pings go. How to add the whole range or what am I doing wrong?

UPD

I wanted to add a range of gateways with one command. It turned out that this is impossible.

    1 answer 1

    The range is set by the mask: route add 172.16.12.0 mask 255.255.255.0

    • As it did not work. Wrote in the spirit of route add -p 172.16.80.95 172.16.12.0 mask 255.255.255.0 - Viktorov
    • The route add command has a certain order of arguments: first comes the "starting address", then the mask, then the gateway address. route -p add 172.16.12.0 mask 255.255.255.0 172.16.80.95 - Sergey Gornostaev
    • something still doesn't work. Well, no way. What am I doing wrong? I tried route add -p 172.16.80.95 172.16.12.0 mask 255.255.255.0 and route add -p 172.16.80.95 mask 255.255.255.0 172.16.12.0 . However, if I add routes one at a time, for example, route add -p 172.16.80.95 172.16.12.125 , then everything works fine - Viktorov
    • Apparently, it is necessary to carefully analyze the details. What is 172.16.80.95? Gateway? Or the starting address of the range? Any errors team gives? - Sergey Gornostaev
    • 2
      It does not work out. One route - one gateway. - Sergey Gornostaev