# ifa_add_loopback_route: insertion failed



## vivek (Dec 23, 2009)

I'm getting the following in /var/log/messages

```
ifa_add_loopback_route: insertion failed
```

What does it mean? Google is not helping either. There are two Ethernet cards and kernel compiled with device carp option and nothing special.


----------



## DutchDaemon (Dec 23, 2009)

I see the opposite of this one:


```
ifa_del_loopback_route: deletion failed
```

As far as I know, it's related to OpenVPN trying to delete a route that's not actually there (which happens when OpenVPN runs on my laptop at home, where it can't set the desired route, because it's already in the network it tries to route to).


----------



## vivek (Dec 24, 2009)

Oh, are you using IPv6? I think they are coming after adding IPv6 ips. I will remove IPv6 and report back my findings.


----------



## vivek (Dec 24, 2009)

Naa it is not related to IPv6, I can repeate this with the following ifconfig command:

```
ifconfig carp0 down
```
After some time

```
ifconfig carp0 up
```
I believe it is a *bug*, I will send it to stable or may be PR. Let me know. Meanwhile I'm trying 7.2 and see if same error occurs.


----------



## DutchDaemon (Dec 24, 2009)

No, no IPv6 here. Are you doing anything with (additional) routing, like VPN routing, static routes, separate routing tables, something like that? I think these messages (whether it's insertion or deletion) are all about making changes to the routing table(s).


----------



## vivek (Dec 24, 2009)

Yes, static routing is there. Here is my rc.conf

```
# connected to the Internet
defaultrouter="74.xx.yy.7" 

# em0 
ifconfig_em0="inet 10.10.29.70 netmask 255.255.255.192 media 100baseTX mediaopt full-duplex"
ifconfig_em0_alias0="inet 10.9.167.67 netmask 255.255.255.0"

# em1
ifconfig_em1="inet 74.xx.yy.9 netmask 255.255.255.248 media 100baseTX mediaopt full-duplex"
ifconfig_em1_alias0="inet 75.xx.yy.27 netmask 255.255.255.248"
ifconfig_em1_alias1="inet 75.xx.yy.10 netmask 255.255.255.248"
ifconfig_em1_alias2="inet 75.xx.yy.2 netmask 255.255.255.248"

# carp
cloned_interfaces="carp0"
ifconfig_carp0="vhid 1 advskew 100 pass password 75.xxx.yyy.zzz/29"

# vlan routing
static_vlan="service"
route_vlan="-net 10.0.0.0/8 10.10.2.1"

# services
sendmail_enable="NO"
sshd_enable="YES"
ntpdate_enable="YES"
ntpdate_flags="time.vlan.example.com"
syslogd_enable="YES"
syslogd_flags="-ss"
kern_securelevel_enable="YES"
nfs_reserved_port_only="YES"
clear_tmp_enable="YES"
ntpd_enable="NO"
openntpd_enable="YES"
ezjail_enable="YES"
```


----------



## vivek (Dec 26, 2009)

I've tested the same config with 7.2 stable and there is no error or message. I think this is Stable 8 issue. I'm still looking into it. However, the following claims that it is patched in Revision 197227:
http://www.mail-archive.com/svn-src-all@freebsd.org/msg13536.html
http://svn.freebsd.org/viewvc/base?view=revision&revision=197227
The following is not returning anything?

```
grep 197227 UPDATING
```

How do I verify that my kernel is patched with r197227?


----------



## DutchDaemon (Dec 26, 2009)

The patch was done to /usr/src/sys/net/if.c.

I have this code in 8-STABLE (Dec 7).


```
* $FreeBSD: src/sys/net/if.c,v 1.359.2.9 2009/09/20 17:46:56 qingli Exp $
```


----------



## DutchDaemon (Dec 26, 2009)

And, indeed, it's been a while since I saw that 'deletion' error on the console.


----------



## vivek (Dec 27, 2009)

Thanks DD!

Okay, I've switched back to 7.2 x( (well just swapped the cables between two sets of boxes) as Monday traffic will be back. I really wanted to use 8.0 stable as it has stack protection and other cool features. I will send my findings to freebsd-pf mailing list on Monday and see if anyone comes with something new for me.

TIA


----------



## wgzcl (Mar 23, 2010)

Hey there.

I want to know if you have any news on this issue.

I work for an ISP and we use FreeBSD servers as BRAS (pppoe servers).

I'd like to know if this messages are really dangerous. Last couple of weeks i've been having some reboot issues, and when i check the logs i got LOTS of this messages. 

The BRAS server runs OSPF to anounce the /32 hosts to our core. Plus the mpd daemon. And that's it.

Thanks in advance.


----------



## ecazamir (Jun 21, 2010)

I see these messages too, on a FreeBSD 8.0-RELEASE-p3, which seems to be patched. sys/net/if_var.h is at version:

```
* $FreeBSD: src/sys/net/if_var.h,v 1.152.2.5.2.1 2009/10/25 01:10:29 kensmith Exp $
```
On a PPPoE server upgraded from 7.1 to 8.0-REPEASE-p3, i see a lot of messages like:

```
ifa_del_loopback_route: deletion failed
ifa_add_loopback_route: insertion failed
```
These errors appear sometimes when a PPPoE client comes up, or is closing a session.
If the error appears, a windows PPPoE client sees the error number 629. This error also appears on any FreeBSD version if there's an attempt to allocate the same IP address to different PPPoE clients.

On my upgrade proccess, I upgraded the base system, ipa_ipfw, but not MPD, which I use to serve PPPoE. I assume that MPD needs rebuilding too, I'll keep you posted when I upgrade MPD.


----------



## ecazamir (Jun 21, 2010)

I've updated mpd5 from version 5.2 to version 5.5, and I see that the messages still appear.

PS: On my previous mesage I said that "This error also appears on any FreeBSD version if there's an attempt to allocate the same IP address to different PPPoE clients."
I must correct myself, this error also appears on Windows PPPoe clients, regardless of FreeBSD server version, if there's an attempt to allocate an already allocated address.


----------



## ecazamir (Jun 23, 2010)

I've updated to 8-STABLE on 2010-06-21, and the messages 
	
	



```
ifa_del_loopback_route: deletion failed
ifa_add_loopback_route: insertion failed
```
 are gone, together with 629 error reported to windows clients.


----------



## AndyUKG (Aug 26, 2010)

Im seeing this on FreeBSD 8.1, amd64.



```
Aug 26 09:26:53 server kernel: ifa_add_loopback_route: insertion failed
```


Additionally I had my server drop off the network, when connected to the console the server was still up so I ran ifconfig -a. This command ran partially, showing me the IPv4 info for the interface 1, then hung before showing the IPv6 section of the same interface. Not sure if that part is related, but just both odd things I noticed in relation to the outage I just experienced....


----------



## Seeker (Dec 19, 2011)

8.2-RELEASE-p4
Cron security run output

```
... kernel log messages:
+++ /tmp/security.VT3oNv7C	2011-12-19 03:03:11.000000000 +0100
+ifa_add_loopback_route: insertion failed
+ifa_add_loopback_route: insertion failed
```
But I don't have any problems.
I use PF.


----------

