rc.conf & static_routes question

Hello everyone :)

In the man page for rc.conf, it has a listing for static_routes....

static_routes="mcast gif0local"
route_mcast="-net 224.0.0.0/4 -iface gif0"
route_gif0local="-host 169.254.1.1 -iface lo0"

I would like to understand more the meanings of "-net" & "-host" in the 2nd & 3rd lines. Is -net referring to an internal interface, & -host to an interface that would be used to hook the box up to the outside world?

Thanks,
jebs
 
These are rewritten as route(8) commands.

The final command for the mcast line is:
Code:
route add -net 224.0.0.0/4 -iface gif0

Which reads in english as:
route all traffic for the 224.0.0.0/4 network via interface gif0.

You can figure out what this network address means via:
http://www.subnet-calculator.com/cidr.php

Similarly, the gif0local line reads as:
route all traffic to host 169.254.1.1 via interface lo0.
 
thanks also ...

I always do this..

Code:
route add default gatewayAddress

without the iface, and the network/mask but explicitly doing it is better...

You can also checkout


Code:
netstat -r

to view your routing....
 
jemate18 said:
thanks also ...

I always do this..

Code:
route add default gatewayAddress
You're doing exactly the same, except that you don't know it.
'default' is an alias for -net 0.0.0.0/0.

Also, default only changes the default route, meaning if no specific route is found. When you have tunnels or multiple interfaces, more routes may be needed.
 
Back
Top