File manager - Edit - /var/www/payraty/helpdesk/public/storage/branding_media/images/dhcp.zip
Back
PK ! LӖ7� � dhclient.confnu �[��� option rfc3442-classless-static-routes code 121 = array of unsigned integer 8; send host-name = gethostname(); request subnet-mask, broadcast-address, time-offset, routers, domain-name, domain-name-servers, domain-search, host-name, dhcp6.name-servers, dhcp6.domain-search, dhcp6.fqdn, dhcp6.sntp-servers, netbios-name-servers, netbios-scope, interface-mtu, rfc3442-classless-static-routes, ntp-servers; timeout 30; PK ! ��g�� � debugnu �[��� # # The purpose of this script is just to show the variables that are # available to all the scripts in this directory. All these scripts are # called from dhclient-script, which exports all the variables shown # before. If you want to debug a problem with your DHCP setup you can # enable this script and take a look at /tmp/dhclient-script.debug. # To enable this script set the following variable to "yes" RUN="no" if [ "$RUN" = "yes" ]; then echo "$(date): entering ${1%/*}, dumping variables." \ >> /tmp/dhclient-script.debug # loop over the 4 possible prefixes: (empty), cur_, new_, old_ for prefix in '' 'cur_' 'new_' 'old_'; do # loop over the DHCP variables passed to dhclient-script for basevar in reason interface medium alias_ip_address \ ip_address host_name network_number subnet_mask \ broadcast_address routers static_routes \ rfc3442_classless_static_routes \ domain_name domain_search domain_name_servers \ netbios_name_servers netbios_scope \ ntp_servers \ ip6_address ip6_prefix ip6_prefixlen \ dhcp6_domain_search dhcp6_name_servers ; do var="${prefix}${basevar}" eval "content=\$$var" # show only variables with values set if [ -n "${content}" ]; then echo "$var='${content}'" >> /tmp/dhclient-script.debug fi done done echo '--------------------------' >> /tmp/dhclient-script.debug fi PK ! SK[>� � dhclient-exit-hooks.d/resolvednu ȯ�� #!/bin/sh ## Sourced, not exec'ed, but helps syntax highlighting # # Script fragment to make dhclient supply nameserver information to resolved # # Tips: # * Be careful about changing the environment since this is sourced # * This script fragment uses bash features # * As of isc-dhcp-client 4.2 the "reason" (for running the script) can be one of the following. # (Listed on man page:) MEDIUM(0) PREINIT(0) BOUND(M) RENEW(M) REBIND(M) REBOOT(M) EXPIRE(D) FAIL(D) RELEASE(D) STOP(D) NBI(-) TIMEOUT(M) # (Also used in master script:) ARPCHECK(0), ARPSEND(0) # (Also used in master script:) PREINIT6(0) BOUND6(M) RENEW6(M) REBIND6(M) DEPREF6(0) EXPIRE6(D) RELEASE6(D) STOP6(D) # (0) = master script does not run make_resolv_conf # (M) = master script runs make_resolv_conf # (D) = master script downs interface # (-) = master script does nothing with this if systemctl is-enabled systemd-resolved > /dev/null 2>&1; then local mystatedir statedir ifindex if [ ! "$interface" ] ; then return fi ifindex=$(cat "/sys/class/net/$interface/ifindex") if [ ! "$ifindex" ]; then return fi mystatedir=/run/network mkdir -p $mystatedir statedir=/run/systemd/resolve/netif mkdir -p $statedir local oldstate="$(mktemp)" # ignore errors due to nonexistent file md5sum "$mystatedir/isc-dhcp-v4-$interface" "$mystatedir/isc-dhcp-v6-$interface" "$mystatedir/ifupdown-inet-$interface" "$mystatedir/ifupdown-inet6-$interface" > "$oldstate" 2> /dev/null || true case "$reason" in BOUND|RENEW|REBIND|REBOOT|TIMEOUT|BOUND6|RENEW6|REBIND6) if [ -n "$new_domain_name_servers" ] ; then cat <<EOF >"$mystatedir/isc-dhcp-v4-$interface" DNS="$new_domain_name_servers" EOF if [ -n "$new_domain_name" ] || [ -n "$new_domain_search" ] ; then cat <<EOF >>"$mystatedir/isc-dhcp-v4-$interface" DOMAINS="$new_domain_search $new_domain_name" EOF fi fi if [ -n "$new_dhcp6_name_servers" ] ; then cat <<EOF >"$mystatedir/isc-dhcp-v6-$interface" DNS6="$new_dhcp6_name_servers" EOF if [ -n "$new_dhcp6_domain_search" ] ; then cat <<EOF >>"$mystatedir/isc-dhcp-v6-$interface" DOMAINS6="$new_dhcp6_domain_search" EOF fi fi ;; EXPIRE|FAIL|RELEASE|STOP) rm -f "/run/network/isc-dhcp-v4-$interface" ;; EXPIRE6|RELEASE6|STOP6) rm -f "/run/network/isc-dhcp-v6-$interface" ;; esac local newstate="$(mktemp)" # ignore errors due to nonexistent file md5sum "$mystatedir/isc-dhcp-v4-$interface" "$mystatedir/isc-dhcp-v6-$interface" "$mystatedir/ifupdown-inet-$interface" "$mystatedir/ifupdown-inet6-$interface" > "$newstate" 2> /dev/null || true if ! cmp --silent "$oldstate" "$newstate" 2>/dev/null; then local DNS DNS6 DOMAINS DOMAINS6 DEFAULT_ROUTE # v4 first if [ -e "$mystatedir/isc-dhcp-v4-$interface" ]; then . "$mystatedir/isc-dhcp-v4-$interface" fi # v4 manual config overrides if [ -e "$mystatedir/ifupdown-inet-$interface" ]; then . "$mystatedir/ifupdown-inet-$interface" fi # v6 preffered if [ -e "$mystatedir/isc-dhcp-v6-$interface" ]; then . "$mystatedir/isc-dhcp-v6-$interface" fi # v6 manual config overrides if [ -e "$mystatedir/ifupdown-inet6-$interface" ]; then . "$mystatedir/ifupdown-inet6-$interface" fi local resolvectl_failed= if [ "$DNS" ] || [ "$DNS6" ] ; then cat <<EOF >"$statedir/$ifindex" # This is private data. Do not parse. LLMNR=yes MDNS=no SERVERS=$(echo $DNS6 $DNS) DOMAINS=$(echo $DOMAINS6 $DOMAINS) EOF if [ -n "$DEFAULT_ROUTE" ]; then cat <<EOF >>"$statedir/$ifindex" DEFAULT_ROUTE=$DEFAULT_ROUTE EOF fi chown systemd-resolve:systemd-resolve "$statedir/$ifindex" # In addition to creating the state file (needed if we run before # resolved is started), also feed the information directly to # resolved. if systemctl --quiet is-active systemd-resolved; then resolvectl llmnr "$ifindex" yes || resolvectl_failed=$? resolvectl mdns "$ifindex" no || resolvectl_failed=$? if [ "$DOMAINS6" ] || [ "$DOMAINS" ]; then resolvectl domain "$ifindex" $DOMAINS6 $DOMAINS || resolvectl_failed=$? else resolvectl domain "$ifindex" "" || resolvectl_failed=$? fi resolvectl dns "$ifindex" $DNS6 $DNS || resolvectl_failed=$? if [ "$DEFAULT_ROUTE" ]; then resolvectl default-route "$ifindex" $DEFAULT_ROUTE || resolvectl_failed=$? fi fi else rm -f "$statedir/$ifindex" if systemctl --quiet is-active systemd-resolved; then resolvectl revert "$ifindex" || resolvectl_failed=$? fi fi # resolved was running, but without dbus, it means state files # will not be read & resolvectl commands failed, restart it if [ "$resolvectl_failed" ]; then systemctl try-restart systemd-resolved fi fi rm -f "$oldstate" "$newstate" fi PK ! �"��� � . dhclient-exit-hooks.d/rfc3442-classless-routesnu �[��� # set classless routes based on the format specified in RFC3442 # e.g.: # new_rfc3442_classless_static_routes='24 192 168 10 192 168 1 1 8 10 10 17 66 41' # specifies the routes: # 192.168.10.0/24 via 192.168.1.1 # 10.0.0.0/8 via 10.10.17.66.41 RUN="yes" if [ "$RUN" = "yes" ]; then if [ -n "$new_rfc3442_classless_static_routes" ]; then if [ "$reason" = "BOUND" ] || [ "$reason" = "REBOOT" ]; then set -- $new_rfc3442_classless_static_routes while [ $# -gt 0 ]; do net_length=$1 via_arg='' case $net_length in 32|31|30|29|28|27|26|25) if [ $# -lt 9 ]; then return 1 fi net_address="${2}.${3}.${4}.${5}" gateway="${6}.${7}.${8}.${9}" shift 9 ;; 24|23|22|21|20|19|18|17) if [ $# -lt 8 ]; then return 1 fi net_address="${2}.${3}.${4}.0" gateway="${5}.${6}.${7}.${8}" shift 8 ;; 16|15|14|13|12|11|10|9) if [ $# -lt 7 ]; then return 1 fi net_address="${2}.${3}.0.0" gateway="${4}.${5}.${6}.${7}" shift 7 ;; 8|7|6|5|4|3|2|1) if [ $# -lt 6 ]; then return 1 fi net_address="${2}.0.0.0" gateway="${3}.${4}.${5}.${6}" shift 6 ;; 0) # default route if [ $# -lt 5 ]; then return 1 fi net_address="0.0.0.0" gateway="${2}.${3}.${4}.${5}" shift 5 ;; *) # error return 1 ;; esac # take care of link-local routes if [ "${gateway}" != '0.0.0.0' ]; then via_arg="via ${gateway}" fi # set route (ip detects host routes automatically) ip -4 route add "${net_address}/${net_length}" \ ${via_arg} dev "${interface}" >/dev/null 2>&1 done fi fi fi PK ! Pq�o o dhclient-exit-hooks.d/chronynu �[��� CHRONY_SOURCEDIR=/run/chrony-dhcp SERVERFILE=$CHRONY_SOURCEDIR/$interface.sources chrony_config() { rm -f "$SERVERFILE" mkdir -p "$CHRONY_SOURCEDIR" for server in $new_ntp_servers; do echo "server $server iburst" >> "$SERVERFILE" done /usr/bin/chronyc reload sources > /dev/null 2>&1 || : } chrony_restore() { if [ -f "$SERVERFILE" ]; then rm -f "$SERVERFILE" /usr/bin/chronyc reload sources > /dev/null 2>&1 || : fi } case $reason in BOUND|RENEW|REBIND|REBOOT) chrony_config ;; EXPIRE|FAIL|RELEASE|STOP) chrony_restore ;; esac PK ! �.*@� � % dhclient-enter-hooks.d/resolved-enternu ȯ�� #!/bin/sh ## Sourced, not exec'ed, but helps syntax highlighting # # Script fragment disabling make_resolv_conf(), # to be used in conjunction with dhclient-exit-hooks.d/resolved # if systemctl is-enabled systemd-resolved > /dev/null 2>&1; then # Undefine the nasty default make_resolv_conf() to avoid it overriding # /etc/resolv.conf (or /run/systemd/resolve/stub-resolv.conf) make_resolv_conf() { : ; } fi PK ! B���� � dhclient-enter-hooks.d/resolvednu ȯ�� # # Script fragment to make dhclient supply nameserver information to resolvconf # # Tips: # * Be careful about changing the environment since this is sourced # * This script fragment uses bash features # * As of isc-dhcp-client 4.2 the "reason" (for running the script) can be one of the following. # (Listed on man page:) MEDIUM(0) PREINIT(0) BOUND(M) RENEW(M) REBIND(M) REBOOT(M) EXPIRE(D) FAIL(D) RELEASE(D) STOP(D) NBI(-) TIMEOUT(M) # (Also used in master script:) ARPCHECK(0), ARPSEND(0) # (Also used in master script:) PREINIT6(0) BOUND6(M) RENEW6(M) REBIND6(M) DEPREF6(0) EXPIRE6(D) RELEASE6(D) STOP6(D) # (0) = master script does not run make_resolv_conf # (M) = master script runs make_resolv_conf # (D) = master script downs interface # (-) = master script does nothing with this if systemctl is-enabled systemd-resolved > /dev/null 2>&1; then # For safety, first undefine the nasty default make_resolv_conf() make_resolv_conf() { : ; } case "$reason" in BOUND|RENEW|REBIND|REBOOT|TIMEOUT|BOUND6|RENEW6|REBIND6) # Define a resolvconf-compatible m_r_c() function # It gets run later (or, in the TIMEOUT case, MAY get run later) make_resolv_conf() { local statedir if [ ! "$interface" ] ; then return fi statedir="/run/systemd/resolved.conf.d" mkdir -p $statedir oldstate="$(mktemp)" md5sum $statedir/isc-dhcp-v4-$interface.conf $statedir/isc-dhcp-v6-$interface.conf > $oldstate 2> /dev/null if [ -n "$new_domain_name_servers" ] ; then cat <<EOF >$statedir/isc-dhcp-v4-$interface.conf [Resolve] DNS=$new_domain_name_servers EOF if [ -n "$new_domain_name" ] || [ -n "$new_domain_search" ] ; then cat <<EOF >>$statedir/isc-dhcp-v4-$interface.conf Domains=$new_domain_search $new_domain_name EOF fi fi if [ -n "$new_dhcp6_name_servers" ] ; then cat <<EOF >$statedir/isc-dhcp-v6-$interface.conf [Resolve] DNS=$new_dhcp6_name_servers EOF if [ -n "$new_dhcp6_domain_search" ] ; then cat <<EOF >>$statedir/isc-dhcp-v6-$interface.conf Domains=$new_dhcp6_domain_search EOF fi fi newstate="$(mktemp)" md5sum $statedir/isc-dhcp-v4-$interface.conf $statedir/isc-dhcp-v6-$interface.conf > $newstate 2> /dev/null if ! cmp --quiet $oldstate $newstate; then # We need to reset-failed to reset the start limit counter, # in case we're processing more than StartLimitBurst interfaces # LP: #1939255 systemctl reset-failed systemd-resolved.service systemctl try-reload-or-restart systemd-resolved.service fi rm $oldstate rm $newstate } ;; EXPIRE|FAIL|RELEASE|STOP) if [ ! "$interface" ] ; then return fi rm -f /run/systemd/resolved.conf.d/isc-dhcp-v4-$interface.conf systemctl try-reload-or-restart systemd-resolved.service ;; EXPIRE6|RELEASE6|STOP6) if [ ! "$interface" ] ; then return fi rm -f /run/systemd/resolved.conf.d/isc-dhcp-v6-$interface.conf systemctl try-reload-or-restart systemd-resolved.service ;; esac fi PK ! 5vn�% % # dhclient-exit-hooks.d/hook-dhclientnu ȯ�� #!/bin/sh # This file is part of cloud-init. See LICENSE file for license information. # This script writes DHCP lease information into the cloud-init run directory # It is sourced, not executed. For more information see dhclient-script(8). is_azure() { local dmi_path="/sys/class/dmi/id/board_vendor" vendor="" if [ -e "$dmi_path" ] && read vendor < "$dmi_path"; then [ "$vendor" = "Microsoft Corporation" ] && return 0 fi return 1 } is_enabled() { # only execute hooks if cloud-init is enabled and on azure [ -e /run/cloud-init/enabled ] || return 1 is_azure } if is_enabled; then case "$reason" in BOUND) cloud-init dhclient-hook up "$interface";; DOWN|RELEASE|REBOOT|STOP|EXPIRE) cloud-init dhclient-hook down "$interface";; esac fi PK ! H_�] ] dhclient-exit-hooks.d/timesyncdnu �[��� TIMESYNCD_CONF=/run/systemd/timesyncd.conf.d/01-dhclient.conf timesyncd_servers_setup_remove() { if [ -e $TIMESYNCD_CONF ]; then rm -f $TIMESYNCD_CONF systemctl try-restart systemd-timesyncd.service || true fi } timesyncd_servers_setup_add() { if [ ! -d /run/systemd/system ]; then return fi if [ -e $TIMESYNCD_CONF ] && [ "$new_ntp_servers" = "$old_ntp_servers" ]; then return fi if [ -z "$new_ntp_servers" ]; then timesyncd_servers_setup_remove return fi mkdir -p $(dirname $TIMESYNCD_CONF) cat <<EOF > ${TIMESYNCD_CONF}.new # NTP server entries received from DHCP server [Time] NTP=$new_ntp_servers EOF mv ${TIMESYNCD_CONF}.new ${TIMESYNCD_CONF} systemctl try-restart systemd-timesyncd.service || true } case $reason in BOUND|RENEW|REBIND|REBOOT) timesyncd_servers_setup_add ;; EXPIRE|FAIL|RELEASE|STOP) timesyncd_servers_setup_remove ;; esac PK ! �йt� � dhclient-enter-hooks.d/confignu ȯ�� #!/bin/sh case "$reason" in BOUND) { echo "DEVICE='$interface'" echo "PROTO='dhcp'" echo "IPV4PROTO='dhcp'" echo "IPV4ADDR='$new_ip_address'" echo "IPV4NETMASK='$new_subnet_mask'" echo "IPV4BROADCAST='$new_broadcast_address'" # Only keep the first router echo "IPV4GATEWAY='${new_routers%% *}'" i=0 for name in $new_domain_name_servers; do echo "IPV4DNS$i='$name'" i=$((i+1)) done echo "ROOTSERVER='${new_routers%% *}'" echo "HOSTNAME='$new_host_name'" echo "DNSDOMAIN='$new_domain_name'" if [ -n "$new_domain_search" ]; then if [ -n "$new_domain_name" ]; then domain_in_search_list="" for domain in $new_domain_search; do if [ "$domain" = "${new_domain_name}" ] || [ "$domain" = "${new_domain_name}." ]; then domain_in_search_list="Yes" fi done if [ -z "$domain_in_search_list" ]; then new_domain_search="$new_domain_name $new_domain_search" fi fi echo "DOMAINSEARCH='${new_domain_search}'" elif [ -n "$new_domain_name" ]; then echo "DOMAINSEARCH='${new_domain_name}'" fi } >"/run/net-$interface.conf" ;; BOUND6) { echo "DEVICE6='$interface'" echo "IPV6PROTO='dhcp6'" echo "IPV6ADDR='$new_ip6_address'" echo "IPV6NETMASK='$new_ip6_prefixlen'" i=0 for name in $new_dhcp6_name_servers; do echo "IPV6DNS$i='$name'" i=$((i+1)) done if [ -n "$new_dhcp6_domain_search" ]; then echo "IPV6DOMAINSEARCH='$new_dhcp6_domain_search'" fi } >"/run/net6-$interface.conf" ;; esac PK ! LӖ7� � dhclient.confnu �[��� PK ! ��g�� � � debugnu �[��� PK ! SK[>� � � dhclient-exit-hooks.d/resolvednu ȯ�� PK ! �"��� � . � dhclient-exit-hooks.d/rfc3442-classless-routesnu �[��� PK ! Pq�o o �$ dhclient-exit-hooks.d/chronynu �[��� PK ! �.*@� � % �'