BeagleBone Black DHCP Server

Installation DHCP Server für das USB0 Interface

apt-get install udhcpd

vim /etc/udhcpd.conf

start      192.168.7.1
end        192.168.7.1
interface  usb0
max_leases 1
option subnet 255.255.255.252

in folgende Datei die Zeile hinzufügen:

vim /etc/network/interfaces

allow-hotplug usb0

es sollte folgende Datei angelegt werden:

vim /etc/network/if-up.d/udhcpd

#! /bin/sh
# Reload the udhcpd server when interface usb0 comes up, to allow it to start
#

set -e

if [ "$IFACE" = usb0 ]; then

        # Only run from ifup.
        if [ "$MODE" != start ]; then
                exit 0
        fi

        # Is /usr mounted?
                if [ ! -e /usr/sbin/udhcpd ]; then
                exit 0
        fi

        if [ -d /run/systemd/system ]; then
                action=restart
                systemctl $action udhcpd >/dev/null 2>&1 || true
        fi
fi

exit 0

Comments

Comments powered by Disqus