# rc.conf & static_routes question



## jebs (Feb 12, 2009)

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


----------



## Mel_Flynn (Feb 12, 2009)

These are rewritten as route(8) commands.

The final command for the mcast line is:

```
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.


----------



## jebs (Feb 13, 2009)

Thanks


----------



## jemate18 (Feb 15, 2009)

thanks also ...

I always do this..


```
route add default gatewayAddress
```

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

You can also checkout



```
netstat -r
```

to view your routing....


----------



## Mel_Flynn (Feb 18, 2009)

jemate18 said:
			
		

> thanks also ...
> 
> I always do this..
> 
> ...


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.


----------

