LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Error: Invalid prefix for given prefix length (https://www.linuxquestions.org/questions/linux-newbie-8/error-invalid-prefix-for-given-prefix-length-4175733884/)

tbarre 02-15-2024 09:20 AM

Error: Invalid prefix for given prefix length
 
Using Ubuntu server, the following commands have been run:

sudo ip addr add 127.0.0.1/24 dev lo
sudo ip addr route 127.0.0.1/24 dev lo

The route command return the following error:

Error: Invalid prefix for given prefix length

I am not sure why.

Any thoughts?

___ 02-16-2024 02:07 AM

sudo ip route add 127.0.0.0/24 dev lo

...1 would require /32
https://www.linuxquestions.org/quest...th-4175703568/
Try searching "<the err msg>" [site:linuxquestions.org]

P.S. 127 should be /8 And no route (to it) is needed.
ping 127.255.255.254 # should succeed!

FYI: your hand transcription of 2nd cmd is incorrect, because what you wrote would say:
Command "route" is unknown, try "ip address help".
https://www.cyberciti.biz/faq/linux-...-usage-syntax/


All times are GMT -5. The time now is 08:52 PM.