6

Forgive the newbie question.

I am trying to setup eth1 in interfaces:

enter image description here

however, I am getting: RTNETLINK answers: file exists

here are the results of ifconfig:

enter image description here

what am i doing wrong?

Alex Gordon
  • 824
  • 6
  • 11
  • 24

2 Answers2

8

If you had been manually setting a temporary configuration, e.g by doing something like sudo ifconfig eth0 10.0.0.100 netmask 255.255.255.0, you should clear that up first:

sudo ip addr flush eth0

Now you can try again:

sudo ip link set eth0 up
Nagev
  • 624
  • 1
  • 12
  • 17
3

Manual methods are unlikely to work correctly if Network Manager is installed and running. If it is installed, it is advisable to set the details there:

If you have removed Network Manager, your interfaces file will also need a gateway and DNS nameservers:

auto lo
iface lo inet loopback

auto eth0
iface eth0 inet static
address 192.168.1.117
netmask 255.255.255.0
gateway 192.168.1.1  #or whatever your router address is
dns-nameservers 192.168.1.1 8.8.8.8

Then get the system to re-read and use the changes:

sudo ifdown eth0 && sudo ifup -v eth0

Check:

ping -c3 www.google.com
Wilf
  • 29,694
  • 16
  • 106
  • 164
chili555
  • 58,968
  • 8
  • 93
  • 129
  • thanks so much! what is the difference between setting these through /etc/..interfaces vs this http://i.stack.imgur.com/j4OPN.png ?? – Alex Gordon Jun 27 '13 at 18:51
  • The difference is that /etc/network/interfaces is designed for manual methods; servers, etc. and Network Manager is designed for the everyday desktop and laptop user. There is a mechanism in NM designed to use the interfaces file if it's filled in, but, in my experience, it's hit and miss. If you have NM installed, I strongly recommend you use that method. Of course, if you are curious, you can try first one and then the other and see what works best for you. – chili555 Jun 27 '13 at 19:24
  • thanks!! so how do i know from which method the settings are being used? – Alex Gordon Jun 27 '13 at 19:25
  • The way it's supposed to work is that NM does the work unless /etc/network/interfaces is filled in and then only if 'managed=false' is set in NetworkManager.conf. http://manpages.ubuntu.com/manpages/precise/man5/NetworkManager.conf.5.html However, if BOTH are filled in, then I think it's anybody's guess what happens. That's why I recommend one or the other, not both. You may get some clues from the terminal: cat /var/log/syslog | grep etwork Are there many references to Network Manager? If so, I suspect it's doing all the work. – chili555 Jun 27 '13 at 20:25
  • If `/etc/network/interfaces` does not exist and networkmanager is the only thing being use, what then? This isn't a ubuntu system but I am still curious :) **EDIT:** nevermind, removed some malformed `/etc/sysconfig/network-scripts/ifcfg-*` files from trying to edit networkmanager using another program - it really it picky about what it uses, and seems to recreate files if it don't like them instead of doing a obvious error... Also for systems using the journal thing it seems to be `journalctl -xe | grep etwork` or `systemctl status network` – Wilf Oct 19 '16 at 22:25
  • If it isn't an Ubuntu system, we don't know and we have no suggestions. – chili555 Oct 19 '16 at 23:53