"route add" how it behaves
Bruce M. Simpson
bms at FreeBSD.org
Tue Feb 13 17:56:53 UTC 2007
Kather Rafi -TLS,Chennai wrote:
> Hi all,
>
> I am new to FreeBSD.
>
> I want to know how the "route add " is working for the network routes
> and host routes in the case of with out specifying the gateway.
>
> In linux we can add like "route add -host 10.0.12.24 eth0" but in
> FreeBSD it should be like "route add -host 10.0.12.24 -iface fxp0"
>
> I want to know
>
> 1. how the flag -iface provides gateway to the route inside
> the kernel.?
>
>
Watch the output of 'route -nv monitor' running in the background when
you do it.
> 2. If it does not provide the gateway address how it
> identifies the ifaddr inside the kernel (ie interface address for the
> particular interface)?
>
If you specify an interface as the next-hop, what you are doing is
asking the link layer to resolve the next-hop.
In the case of a PPP interface, it should just send the packet to the
next hop (example: someone running PPP over RFCOMM with Bluetooth with
Proxy-ARP to bridge the Bluetooth endpoint device onto a LAN).
In the case of Ethernet (a CSMA/CD broadcast LAN which uses BSD's
route-cloning facility), it should ARP for the address.
The 'route' command actually manages the Forwarding Information Base
(FIB) or 'forwarding table'. We just call it the 'routing table' though
that is a misnomer. The Layer 2 entries ('ARP table') are also contained
within the FreeBSD FIB.
FreeBSD usually relies on an interface having an IPv4 number.The results
for an unnumbered PPP interface, which is not bridging in the example
above, may be undefined.
In the case of Ethernet, it's quite possible that an entity on the
directly attached LAN knows how to resolve the next-hop by doing Proxy
ARP on its behalf.
Hope this clarifies matters.
Regards,
BMS
More information about the freebsd-net
mailing list