-3

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.

1
  • Can you post the output of nmcli dev status Jan 18 '14 at 12:12
2

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.

3
  • 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. 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 ? Jan 19 '14 at 20:57
1

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

auto eth0
iface eth0 inet static
        address 192.168.1.2
        netmask 255.255.255.0
        gateway 192.168.1.1

To leave the interface unconfigured add those lines:

auto eth0
iface eth0 inet manual
1
  • 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. Jan 21 '14 at 9:00
0

Just edit /etc/network/interfaces.

2
  • There is nothing there, only "auto lo" and "iface lo inet loopback". Not a clue what to add. 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.