OpenSUSE Leap 42: Install dhcp-server for DHCP server

Table of Contents

1 Install dhcp-server

Install dhcp-server with zypper.

> sudo zypper -n in dhcp-server> sudo systemctl enable dhcpd

You must set DHCPD_INTERFACE in /etc/sysconfig/dhcpd. Set interface name which is displayed by /sbin/ifconfig. This article uses “eth0”.

> sudo sed -e ‘s/^DHCPD_INTERFACE=.*/DHCPD_INTERFACE=”eth0″/g’ -i /etc/sysconfig/dhcpd

2 /etc/dhcpd.conf

Define domain name, DHCP server and gateway. Mapping MAC address 52:54:00:5e:7a:a4 to IP address

> cat <<EOF | sudo tee /etc/dhcpd.confsubnet netmask { option domain-name “”; option domain-name-servers,; option routers;}host opensuse-14-dhcp-client { hardware ethernet 52:54:00:5e:7a:a4; fixed-address;}EOF

Restart dhcpd.

> sudo systemctl restart dhcpd

3 Execution result

Checking IP address on client machine.

IP address is provided.

> ip a s<snip>2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_faststate UP group default qlen 1000 link/ether 52:54:00:5e:7a:a4 brd ff:ff:ff:ff:ff:ff inet brd scope global eth0 valid_lft forever preferred_lft forever inet6 fe80::5054:ff:fe5e:7aa4/64 scope link valid_lft forever preferred_lft forever

DNS information is provided.

> cat /etc/resolv.conf<snip>search hiroom2.comnameserver

Android | Linux | SDL - Narrow Escape