1 Reply Latest reply: Mar 31, 2013 2:54 PM by Amit Shil RSS

    RTNETLINK answers: File exists while doing ifup

    Amit Shil
      Hi Guys,

      New to the forum, have got an issue while setting up static routing.

      i have got a VM on OEL5u6, normal setup without any static routing has got the below routing table...

      [root@oraclelinuxvm1 network-scripts]# route
      Kernel IP routing table
      Destination Gateway Genmask Flags Metric Ref Use Iface
      192.167.25.0 * 255.255.255.248 U 0 0 0 eth0-eth1
      192.169.25.0 * 255.255.255.248 U 0 0 0 eth1
      10.0.4.0 * 255.255.255.0 U 0 0 0 eth2
      192.168.122.0 * 255.255.255.0 U 0 0 0 virbr0
      link-local * 255.255.0.0 U 1002 0 0 eth0-eth1
      link-local * 255.255.0.0 U 1003 0 0 eth1
      link-local * 255.255.0.0 U 1004 0 0 eth2
      default 10.0.4.2 0.0.0.0 UG 0 0 0 eth2

      i want to change this and use the box as a gateway so that 192.167.25.0 passes through 192.167.25.2 and 192.169.25.0 passes through 192.169.25.2 (both of them configured on separte eths) .. now i can do this quite easily using the ip route add command and once done it works happily, however the issue comes when i try to use persistence (so that the setup remains like this during reboots)

      created files

      [root@oraclelinuxvm1 network-scripts]# ls route*
      route-eth0-eth1 route-eth1

      contents as follows

      [root@oraclelinuxvm1 network-scripts]# cat route*
      #default via 192.167.25.2 dev eth0-eth1
      192.167.25.0/29 via 192.167.25.2 dev eth0-eth1
      default via 192.169.25.2 dev eth1
      192.169.25.0/29 via 192.169.25.2 dev eth1


      now with this in place when i try to either do ifdown followed by a ifup or restart the service it gives me a

      [root@oraclelinuxvm1 network-scripts]# service network restart
      Shutting down interface eth0-eth1: [  OK  ]
      Shutting down interface eth1: [  OK  ]
      Shutting down loopback interface: [  OK  ]
      Bringing up loopback interface: [  OK  ]
      Bringing up interface eth0-eth1: RTNETLINK answers: File exists
      [  OK  ]
      Bringing up interface eth1: RTNETLINK answers: File exists
      [  OK  ]


      consequently the route doesn't reflect any changes ... i have roamed around google but don't seem to pin point the issue, i realise that somehow the ifups and the restart of the n/w service is setting up the route first for the subnets and the route files i created are referenced next, since the routes are already set the route file when referenced to set the rotues next encounteres and error...


      so can you guys point me in the direction of resolving this? much appreciated.

      Regards Amit
        • 1. Re: RTNETLINK answers: File exists while doing ifup
          Amit Shil
          Hello All,

          I have just hit a goldmine and found the solution trawling through the docs in /usr/share, apparently routes-ethx method is not recognized either in OEL or in the latest RHEL kernel ... they prescribe adding in /etc/sysconfig/static-routes which is what precisely i did and whoa!! its working, so just to document the solution, this is what i did..

          [root@oraclelinuxvm1 init.d]# head /etc/sysconfig/static-routes
          any net 192.167.25.0 netmask 255.255.255.248 gw 192.167.25.2 dev eth0-eth1
          any net 192.169.25.0 netmask 255.255.255.248 gw 192.169.25.2 dev eth1

          and after a network restart, here's what my routing table looks like..

          [root@oraclelinuxvm1 init.d]# route -n
          Kernel IP routing table
          Destination Gateway Genmask Flags Metric Ref Use Iface
          192.167.25.0 192.167.25.2 255.255.255.248 UG 0 0 0 eth0-eth1
          192.167.25.0 0.0.0.0 255.255.255.248 U 0 0 0 eth0-eth1
          192.169.25.0 192.169.25.2 255.255.255.248 UG 0 0 0 eth1
          192.169.25.0 0.0.0.0 255.255.255.248 U 0 0 0 eth1
          10.0.4.0 0.0.0.0 255.255.255.0 U 0 0 0 eth2
          192.168.122.0 0.0.0.0 255.255.255.0 U 0 0 0 virbr0
          169.254.0.0 0.0.0.0 255.255.0.0 U 1002 0 0 eth0-eth1
          169.254.0.0 0.0.0.0 255.255.0.0 U 1003 0 0 eth1
          169.254.0.0 0.0.0.0 255.255.0.0 U 1004 0 0 eth2
          0.0.0.0 10.0.4.2 0.0.0.0 UG 0 0 0 eth2

          wonderful isn't it? ... Happy Easter folks ..

          Regards Amit

          Edited by: AmitShil on 31-Mar-2013 12:54