# Route already in table (FreeBSD 7.X)



## TylerJ (Jan 21, 2015)

I have a question regarding routes in FreeBSD 7.X I have a static route that I've added with:

`route add -host 255.255.255.255 -interface lagg0`

This works correctly, and `netstat -r` shows:


```
Internet:
Destination        Gateway            Flags    Refs      Use  Netif Expire
default           some-router UGS         0    24050  lagg0
< some other entries >
255.255.255.255 ff:ff:ff:ff:ff:ff UHLSb 1 0 lagg0
```

If I change it to use a different interface, I can do that as well via:

`route add -host 255.255.255.255 -interface bge0`


```
Internet:
Destination        Gateway            Flags    Refs      Use  Netif Expire
default            some-router UGS         0    24050  lagg0
< some other entries >
255.255.255.255    00:60:dd:45:8a:ec  UHSb        0        0   bge0
```

However, if I try and add BACK the original interface, it complains:

`route add -host 255.255.255.255 -interface lagg0`


```
route: writing to routing socket: File exists
add host 255.255.255.255: gateway lagg0: route already in table
```

I wanted to know if this is expected behavior. I did some debugging in with sys/net/route.c and saw that it's sending back an EEXIST code, but I'm unsure why it would choose to do that. I'm assuming its because of a duplicate dst/netmask/gw pairs, but this doesn't seem right in that context. Can anyone confirm this is expected behavior? I looked at FreeBSD-CURRENT and it looks like there's a slightly different implementation. Wasn't sure if this had been a known bug or not (searched for it, but wasn't turning up results).


----------



## Juanitou (Jan 21, 2015)

Thread topics-about-unsupported-freebsd-versions.40469/
Thread formatting-guidelines.49535/


----------

