0

How add to route, for example IP Range 192.168.0.0 and mask 255.255.255.0

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

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

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

Any variants?

1 Answer 1

2

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

ip route add 192.168.0.0/24 dev ppp0

ip route add 192.168.0.0/255.255.255.0 ppp0

0

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.