[Xorp-users] AF_NETLINK NLMSG_ERROR message: File exists

Pavlin Radoslavov pavlin@icir.org
Thu, 07 Oct 2004 16:29:54 -0700


> My /etc/network/interfaces contains that :
> -----------
> iface eth1 inet static
>         address 10.0.0.1
>         netmask 255.255.255.0
> -----------
> 
> My config.boot :
> -----------
> interfaces {
>     interface eth1 {
>         description: "test interface"
>         enabled: true
>         vif eth1 {
>             enabled: true
>             address 10.0.0.1 {
>                 prefix-length: 24
>                 broadcast: 10.0.0.255
>                 enabled: true
>             }
>         }
>     }
> }
> 
> fea {
>     enable-unicast-forwarding4: true
>     enable-unicast-forwarding6: true
> }
> ------------
> 
> netlink_dev has nothing to do with the problem. To reproduce the
> problem, I had first to reboot because I can't reproduce it after it is
> fixed. =20
> 
> xbr@bush:~$ ip addr
> [...]
> 3: eth1: <BROADCAST,MULTICAST,UP> mtu 1500 qdisc pfifo_fast qlen 1000
>     link/ether 00:07:e9:ad:80:92 brd ff:ff:ff:ff:ff:ff
>     inet 10.0.0.1/24 brd 10.255.255.255 scope global eth1
>     inet6 fe80::207:e9ff:fead:8092/64 scope link
>        valid_lft forever preferred_lft forever

<DEL>

> Has it to do with the fact that the broadcast address of eth1 is
> misconfigured in the first place ?

Yes, I think this is the key to the problem.

E.g., you can try the following:

* Make sure that the network interface has no assigned addresses:

root@xorp4[28] ip addr del dev eth0 10.0.0.1/24
root@xorp4[29] ip addr
...
2: eth0: <BROADCAST,MULTICAST,UP> mtu 1500 qdisc pfifo_fast qlen 100
    link/ether 00:04:5a:58:18:45 brd ff:ff:ff:ff:ff:ff
    inet6 fe80::204:5aff:fe58:1845/10 scope link 
...


* Add the 10.0.0.1/24, but with the broadcast address
   set to 10.255.255.255:

root@xorp4[30] ip addr add dev eth0 10.0.0.1/24 brd 10.255.255.255
root@xorp4[31] ip addr
...
2: eth0: <BROADCAST,MULTICAST,UP> mtu 1500 qdisc pfifo_fast qlen 100
    link/ether 00:04:5a:58:18:45 brd ff:ff:ff:ff:ff:ff
    inet 10.0.0.1/24 brd 10.255.255.255 scope global eth0
    inet6 fe80::204:5aff:fe58:1845/10 scope link 
...

* Try to add again 10.0.0.1/24, but this time trying to set the
  broadcast address to its correct value of 10.0.0.255):

root@xorp4[32] ip addr add dev eth0 10.0.0.1/24 brd 10.0.0.255
RTNETLINK answers: File exists
Exit 2

The above error is exactly what happens when you try to do it via
XORP. Basically, it appears that the Linux kernel doesn't like it to
set the same IP address twice, but with a different broadcast
address.

Below are some suggestions how to get around this problem:

 a) Modify your /etc/network/interfaces setup to explicitly set
    the broadcast address to its correct value. Though, I have to
    admit that I am not familiar with the Debian network interfaces
    setup, hence I don't know whether this is actually possible.
    Alternatively, if you don't need that particular interface
    being configured on startup, then don't configure it inside
   /etc/network/interfaces, and let it be configured by XORP only.

 b) Modify your XORP configuration to specify broadcast address of
    10.255.255.255 so there won't be mismatch in the broadcast address
    when XORP tries to set the interface.

 c) Identify the Debian start-up software bug that sets incorrectly
    the broadcast address and fix it :)

Regards,
Pavlin