Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

How do I configure eth1 (via terminal commands) to stop using DHCP. That is, if I had the ability to use the GUI, I would select the MANUAL setting.

share|improve this question

closed as unclear what you're asking by slm, Anthon, jasonwryan, Zelda, rahmu Jan 21 '14 at 12:09

Please clarify your specific problem or add additional details to highlight exactly what you need. As it's currently written, it’s hard to tell exactly what you're asking. See the How to Ask page for help clarifying this question.If this question can be reworded to fit the rules in the help center, please edit the question.

Can you post the output of nmcli dev status – Mark Plotnick Jan 18 '14 at 12:12

Assuming you are using Ubuntu:

Edit /etc/network/interfaces

auto lo eth0
iface lo inet loopback
iface eth0 inet static
        address xxx.xxx.xxx.xxx(enter your ip here)
        netmask xxx.xxx.xxx.xxx
        gateway xxx.xxx.xxx.xxx(enter gateway ip here,usually the address of the router)

Then edit /etc/resolv.conf

nameserver xxx.xxx.xxx.xxx(enter your dns server ip)
nameserver xxx.xxx.xxx.xxx(enter your alt dns)

Restart the network and you should be oki.

share|improve this answer
It doesn't work, let me provide more details. I am remotely connecting into a linux box. This box has 3 network interfaces, the one I need to use is eth1. This interface is going to talk to a hardware device, so I need to set the ip address to one in the same subnet as the device, when I do so, it is removed after a few seconds because the interface is using dhcp. I've edited the file as suggested but it does not help. – Oscar_Mariani Jan 17 '14 at 14:07
Well please post the contents of your config gile. Notice I've used eth0 as device on my example, did ou replace it by eth1? – vfbsilva Jan 17 '14 at 16:07
Looks like his system is using NetworkManager - he has a comment below about interfaces containing only entries for lo0. Is there a way, using nmcli, say, to have NetworkManager stop managing eth1 ? – Mark Plotnick Jan 19 '14 at 20:57

To set the interface static add to /etc/network/interfaces:

auto eth0
iface eth0 inet static

To leave the interface unconfigured add those lines:

auto eth0
iface eth0 inet manual
share|improve this answer
Modifying /etc/network/interfaces did not achieve anything, the problem was that even if the box was being run remotely with a terminal window, the OS had been installed with a GUI running on it that I was not aware of, which had a daemon that was bringing stuff back to what it was before. All I had to do was plug a monitor and a keyboard to the box and do the changes using the GUI interface. – Oscar_Mariani Jan 21 '14 at 9:00

Just edit /etc/network/interfaces.

share|improve this answer
There is nothing there, only "auto lo" and "iface lo inet loopback". Not a clue what to add. – Oscar_Mariani Jan 17 '14 at 13:35
Sorry for the incomplete answer, see chaos' answer. – schaiba Jan 17 '14 at 13:53

Not the answer you're looking for? Browse other questions tagged or ask your own question.