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

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





没有评论:

发表评论

youtube的dns屏蔽方法

  216.239.38.120 是 Google 提供的一个特殊 DNS 服务器,用于强制开启 YouTube 受限模式(Restricted Mode) 。 如果你想在家里强制 YouTube 进入受限模式,可以在 路由器的 DNS 设置 中配置以下 DNS 服务器: D...