how to set a route to an AF_LINK type

Ruslan Ermilov ru at freebsd.org
Fri Dec 2 08:18:44 GMT 2005


On Thu, Dec 01, 2005 at 11:27:19PM -0800, Mark Jayson Alvarez wrote:
>  
> Hi,
>  
>  I'm not sure what I did wrong. My carp setup with 2 machines sharing 1 
> virtual ip is working perfect for 3 days now, until today, I got these 
> messages in /var/log/messages
>  
>  kernel: carp: incorrect hash
>  arp_rtrequest:bad gateway 10.10.8.146 (!AF_LINK)
>  
>  googling brought me to this link:
>  
> http://lists.freebsd.org/pipermail/freebsd-net/2004-January/002608.html
>  
>  However, It doesn't show how to resolve the problem. After rebooting 
> the machine, it still doesn't work (when it is supposed to)
>  Netstat -rn gives me:
>  
>  default            10.10.8.254        UGS         0     1074    xl0
>  10.10.8/24         link#1             UC          0        0    xl0
>  10.10.8.112        00:0e:a6:c9:ac:19  UHLW        1       46    xl0   
> 1186
>  10.10.8.254        00:01:02:9a:7f:c3  UHLW        2        1    xl0    
> 827
>  127.0.0.1          127.0.0.1          UH          0        0    lo0
>  
> 
> Is the route type (AF_LINK) configurable? where? How will I know if it is an AF_LINK type? 
> Rebooting doesn't fix the corrupted routing table either.
>  Any idea how to eliminate the problem?
> 
It's the gateway's address family that is AF_LINK, not a "route type".
For example, routes for 10.10.8.112 and 10.10.8.254 have gateways of
type AF_LINK (Ethenet addresses).  I don't know about this specific
problem, but adding a route with AF_LINK gateway can be done using a
route(8) command, for example:

# route add -host 1.2.3.4 -link :0.1.2.3.4.5 -ifp lo0

Which doesn't make any sense, and is presented only to demonstrate
the ability to add AF_LINK gateway.  The following command adds an
"ARP route" through em0 which doesn't have a corresponding network,
and is otherwise not possible to do with the arp(8) command:

# route add -host 1.2.3.4 -link :0.1.2.3.4.5 -ifp em0 -iface
add host 1.2.3.4: gateway :0.1.2.3.4.5
# arp -n 1.2.3.4
? (1.2.3.4) at 00:01:02:03:04:05 on em0 permanent [ethernet]


Cheers,
-- 
Ruslan Ermilov
ru at FreeBSD.org
FreeBSD committer
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 187 bytes
Desc: not available
Url : http://lists.freebsd.org/pipermail/freebsd-net/attachments/20051202/81613bb1/attachment.bin


More information about the freebsd-net mailing list