How add to route, for example IP Range and mask

I know that: = 24 (cidr), but i need make command in sh script, like:

route add -net netmask dev ppp0 but exactly with ip route ?

Repeat: , i get as variable in script. , i know about ip route add dev ppp0

Any variants?

1 Answer 1


You can pass the netmask in both way, just split by a slash:

ip route add dev ppp0

ip route add ppp0


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.