2020年10月8日星期四

在synology的DHCP中加入新的dhcp option

created a file in here which i called "dhcpd-extras.conf" and added the extra options i wanted for the dhcp server. use the same tags as you can see in the /etc/dhcpd/dhcpd.conf file, which should be like "dhcp-option=tag:eth00,option:tftp-server-name,192.168.0.12" unless you have some exotic setup.

编辑 /etc/rc.network

find the part that looks like:

if [ "${CONF_LIST}" = "" ]; then

    return 1;

fi

在其后加入以下代码:

local CONF_EXTRAS="/path/dhcpd-extras.conf"

if [ -e ${CONF_EXTRAS} ]; then

    CONF_LIST="${CONF_LIST} ${CONF_EXTRAS}"

fi

 保存后退出

重启DSM

 just remember to add the changes to the rc.network file each time you update the disk station firmware/os

内容修改后:

    if [ "${CONF_LIST}" = "" ]; then

        return 1;

    fi

####################################################################################

local CONF_EXTRAS="/etc/dhcpd/dhcpd-extras.conf"

if [ -e ${CONF_EXTRAS} ]; then

    CONF_LIST="${CONF_LIST} ${CONF_EXTRAS}"

fi

######################################################################################

    DNS_INFO_FILE="/etc/dhcpd/dhcpd-dns-dns.info"

    DNS_CONF_FILE="/etc/dhcpd/dhcpd-dns-dns.conf"

    isEnable=`/bin/get_key_value ${DNS_INFO_FILE} enable`

    if [ "x${isEnable}" = "xyes" ] && [ -f ${DNS_CONF_FILE} ]; then

        CONF_LIST="${CONF_LIST} ${DNS_CONF_FILE}"

    fi

可能会因版本等原因,上面代码会有所出入





没有评论:

发表评论

在PVE使用虚拟 USB 存储设备 + ARPL 引导 DSM

  部分内容来自: https://blog.myds.cloud/archives/synoboot-usb-image-in-pve-virtual-machine.html 虚拟机建好之后,打开配置文件 nano /etc/pve/qemu-server/100.conf ...