4

Error/stdout

 /etc/init.d/networking restart
 * Reconfiguring network interfaces...
SIOCADDRT: File exists
Failed to bring up eth0.
   ...done.
netstat -nr
Kernel IP routing table
Destination     Gateway         Genmask         Flags   MSS Window  irtt Iface
10.0.1.0        0.0.0.0         255.255.255.0   U         0 0          0 eth0
0.0.0.0         10.0.1.1        0.0.0.0         UG        0 0          0 eth0
0.0.0.0         10.0.1.1        0.0.0.0         UG        0 0          0 eth0


ip route list
10.0.1.0/24 dev eth0  proto kernel  scope link  src 10.0.1.14  metric 1 
default via 10.0.1.1 dev eth0  proto static 
default via 10.0.1.1 dev eth0  metric 100 


/etc/network# more interfaces 
auto eth0
iface eth0 inet static
    address 10.0.1.14
    netmask 255.255.255.0
    network 10.0.1.0
    broadcast 10.0.1.255
    gateway 10.0.1.1
more hosts
127.0.0.1   jenkins-server-1.bts.md  jenkins-server-1
10.0.1.14   jenkins-server-1.bts.md jenkins-server-1 # Added by NetworkManager
#127.0.0.1  localhost.localdomain   localhost
127.0.0.1   jenkins-server-1.bts.md  jenkins-server-1
#127.0.0.1  jenkins-server-1.bts.md  jenkins-server-1
::1 jenkins-server-1    localhost6.localdomain6 localhost6
#127.0.0.1  jenkins-server-1.bts.md jenkins-server-1
#::1    jenkins-server-1    localhost6.localdomain6 localhost6
#127.0.1.1  jenkins-server-1.bts.md
# The following lines are desirable for IPv6 capable hosts
#::1     localhost ip6-localhost ip6-loopback
::1     jenkins-server-1 ip6-localhost ip6-loopback
fe00::0 ip6-localnet
ff00::0 ip6-mcastprefix
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters
ff02::3 ip6-allhosts
Khaled
  • 35,688
  • 8
  • 69
  • 98
kamal
  • 509
  • 4
  • 10
  • 21

4 Answers4

6

As background information: In the context of network configuration, the File Exists error message is a bit misleading. What it means is that the network element you're trying to add (usually a network route) conflicts with an existing one or has already been added.

For example, you'll get this error if you try to add a "default" route if it has already been set.

tylerl
  • 14,885
  • 7
  • 49
  • 71
3

If you are changing the network configuration, it is normal to get such type of errors when restarting the network. If you are not accessing the machine remotely, you can first stop the network and then start it. If your configuration is fine, the interface(s) should be up again.

If you are still getting errors, you can try using ifconfig directly.

Khaled
  • 35,688
  • 8
  • 69
  • 98
0

In my case, the gateway had a problem. When I restarted gateway computer, and rerun the statement:

/etc/init.d/networking restart

The error message gone and worked properly.

Scott Pack
  • 14,717
  • 10
  • 51
  • 83
Ebru Yener
  • 121
  • 6
0

This is really silly but my network cable was unplugged... Layer 1 problems!

So check your network cable too!

Shrout1
  • 343
  • 2
  • 6
  • 18
  • 1
    This does not really answer the question. If you have a different question, you can ask it by clicking [Ask Question](https://serverfault.com/questions/ask). You can also [add a bounty](https://serverfault.com/help/privileges/set-bounties) to draw more attention to this question. - [From Review](/review/low-quality-posts/358222) – chicks Feb 22 '18 at 17:43
  • @chicks This was the answer that I came upon while troubleshooting - my response would have saved about 20 minutes of additional work. The error message does not make it obvious that a cable could be missing. No one notes that in any answer here. It's another possible solution and it's worth mentioning! – Shrout1 Feb 22 '18 at 17:47