Заметки сисадмина » Can’t start eth1 and dhcp on debian

Заметки сисадмина о интересных вещах из мира IT, инструкции и рецензии. Настраиваем Компьютеры/Сервера/1С/SIP-телефонию в Москве

Can’t start eth1 and dhcp on debian

2024-03-01 · Posted in Debian

What I want:

  • eth0 is connected to internet and has a static IP-address.
  • eth1 connected to internal network and be a dhcp server for subnet.

But I can’t get eth1 to work. Error:

ifconfig -a

Configuration file:

/etc/network/interfaces

/etc/default/isc-dhcp-server

/etc/dhcp/dhcpd.conf

Solution #1:

Also note that ifconfig is deprecated since 1999, use ip addr instead (ifupdown is not deprected through).

ifupdown has this little problem that it cannot detect “invalid” options because these options are passed as environment variables and there is no way to tell if a ifupdown helper script uses a certain environment variable. In theory, there could be a ifupdown helper script that uses an option called “adress”, and it would be perfectly valid. An improvement would require that existing helpers list the options they accept, so would break many existing scripts.

Solution #2:

I had the same error message, no exactly typos, but I copied the interfaces format from some website. It was like this:

Removing the “double spaces” in iface line changed the original error from ‘unknown device eth1’ to ‘Missing required variable: address’, but notice there was no typo in the word ‘address’, only an initial space on each line from that one on. Removing the leading spaces in from of each line solved my issue. Just to be sure, I inserted the extra spaces again and all goes ok, so it was indeed some unknown invisible character I’ve copied form the web and couldn’t tell it.

Leave a Reply