/usr/sbin
NameSizeModeActions
a2disconf162760755editdlrm
a2dismod162760755editdlrm
a2dissite162760755editdlrm
a2enconf162760755editdlrm
a2enmod162760755editdlrm
a2ensite162760755editdlrm
a2query98700755editdlrm
aa-remove-unknown30680755editdlrm
aa-status641200755editdlrm
aa-teardown1370755editdlrm
accessdb149040755editdlrm
add-shell10510755editdlrm
addgnupghome30750755editdlrm
addgroup382470755editdlrm
adduser382470755editdlrm
agetty568960755editdlrm
apache27587360755editdlrm
apache2ctl72290755editdlrm
apachectl72290755editdlrm
apparmor_parser15480640755editdlrm
apparmor_status641200755editdlrm
applygnupgdefaults22170755editdlrm
arp630880755editdlrm
arpd269600755editdlrm
arptables2242960755editdlrm
arptables-nft2242960755editdlrm
arptables-nft-restore2242960755editdlrm
arptables-nft-save2242960755editdlrm
arptables-restore2242960755editdlrm
arptables-save2242960755editdlrm
badblocks351440755editdlrm
bcache-super-show146480755editdlrm
biosdecode237600755editdlrm
blkdeactivate163510755editdlrm
blkdiscard229120755editdlrm
blkid516240755editdlrm
blkzone352000755editdlrm
blockdev311040755editdlrm
bridge947120755editdlrm
cache_check13896080755editdlrm
cache_dump13896080755editdlrm
cache_metadata_size13896080755editdlrm
cache_repair13896080755editdlrm
cache_restore13896080755editdlrm
cache_writeback13896080755editdlrm
capsh310320755editdlrm
cfdisk970080755editdlrm
cgdisk1540960755editdlrm
chcpu311040755editdlrm
check_forensic9520755editdlrm
chgpasswd595280755editdlrm
chmem352000755editdlrm
chpasswd554640755editdlrm
chroot394320755editdlrm
cpgr494480755editdlrm
cppw494480755editdlrm
cron517920755editdlrm
cryptdisks_start15440755editdlrm
cryptdisks_stop8440755editdlrm
cryptsetup1736160755editdlrm
cryptsetup-reencrypt925440755editdlrm
cryptsetup-ssh240960755editdlrm
ctrlaltdel147200755editdlrm
dbconfig-generate-include126560755editdlrm
dbconfig-load-include57040755editdlrm
dcb824480755editdlrm
debugfs2353200755editdlrm
delgroup164950755editdlrm
deluser164950755editdlrm
depmod1703520755editdlrm
devlink1462880755editdlrm
dhclient4532800755editdlrm
dhclient-script163040755editdlrm
dmeventd515920755editdlrm
dmidecode1259360755editdlrm
dmsetup1751280755editdlrm
dmstats1751280755editdlrm
dosfsck843600755editdlrm
dosfslabel393040755editdlrm
dpkg-preconfigure36630755editdlrm
dpkg-reconfigure44850755editdlrm
dumpe2fs310400755editdlrm
e2freefrag146480755editdlrm
e2fsck3602800755editdlrm
e2image433280755editdlrm
e2label1050160755editdlrm
e2mmpstatus310400755editdlrm
e2scrub72960755editdlrm
e2scrub_all53950755editdlrm
e2undo228400755editdlrm
e4crypt311040755editdlrm
e4defrag310320755editdlrm
ebtables2242960755editdlrm
ebtables-nft2242960755editdlrm
ebtables-nft-restore2242960755editdlrm
ebtables-nft-save2242960755editdlrm
ebtables-restore2242960755editdlrm
ebtables-save2242960755editdlrm
era_check13896080755editdlrm
era_dump13896080755editdlrm
era_invalidate13896080755editdlrm
era_restore13896080755editdlrm
escapesrc229920755editdlrm
ethtool5647120755editdlrm
faillock144880755editdlrm
fatlabel393040755editdlrm
fdisk1130720755editdlrm
filefrag187600755editdlrm
findfs147200755editdlrm
fixparts598800755editdlrm
fsadm245190755editdlrm
fsck434400755editdlrm
fsck.btrfs11850755editdlrm
fsck.cramfs311680755editdlrm
fsck.ext23602800755editdlrm
fsck.ext33602800755editdlrm
fsck.ext43602800755editdlrm
fsck.fat843600755editdlrm
fsck.minix557120755editdlrm
fsck.msdos843600755editdlrm
fsck.vfat843600755editdlrm
fsck.xfs19400755editdlrm
fsfreeze147200755editdlrm
fstab-decode187440755editdlrm
fstrim433920755editdlrm
gdisk1786720755editdlrm
genccode150880755editdlrm
gencmn150880755editdlrm
genl926080755editdlrm
gennorm2644080755editdlrm
gensprep274480755editdlrm
getcap146480755editdlrm
getpcaps146480755editdlrm
getty568960755editdlrm
groupadd685200755editdlrm
groupdel642320755editdlrm
groupmems554880755editdlrm
groupmod684240755editdlrm
grpck595280755editdlrm
grpconv512080755editdlrm
grpunconv512080755editdlrm
grub-bios-setup9640160755editdlrm
grub-install12041280755editdlrm
grub-macbless9514080755editdlrm
grub-mkconfig88050755editdlrm
grub-mkdevicemap2208800755editdlrm
grub-probe9639520755editdlrm
grub-reboot48410755editdlrm
grub-set-default35560755editdlrm
halt11198560755editdlrm
hdparm1427760755editdlrm
httxt2dbm146480755editdlrm
hwclock517120755editdlrm
iconvconfig311280755editdlrm
icupkg236560755editdlrm
ifconfig790240755editdlrm
init18499920755editdlrm
insmod1703520755editdlrm
installkernel26590755editdlrm
integritysetup553680755editdlrm
invoke-rc.d165070755editdlrm
ip7188960755editdlrm
ip6tables2242960755editdlrm
ip6tables-apply70570755editdlrm
ip6tables-legacy992720755editdlrm
ip6tables-legacy-restore992720755editdlrm
ip6tables-legacy-save992720755editdlrm
ip6tables-nft2242960755editdlrm
ip6tables-nft-restore2242960755editdlrm
ip6tables-nft-save2242960755editdlrm
ip6tables-restore2242960755editdlrm
ip6tables-restore-translate2242960755editdlrm
ip6tables-save2242960755editdlrm
ip6tables-translate2242960755editdlrm
ipmaddr187440755editdlrm
iptables2242960755editdlrm
iptables-apply70570755editdlrm
iptables-legacy992720755editdlrm
iptables-legacy-restore992720755editdlrm
iptables-legacy-save992720755editdlrm
iptables-nft2242960755editdlrm
iptables-nft-restore2242960755editdlrm
iptables-nft-save2242960755editdlrm
iptables-restore2242960755editdlrm
iptables-restore-translate2242960755editdlrm
iptables-save2242960755editdlrm
iptables-translate2242960755editdlrm
iptunnel187440755editdlrm
irqbalance684640755editdlrm
irqbalance-ui352080755editdlrm
iscsi-iname146480755editdlrm
iscsiadm4080240755editdlrm
iscsid3057200755editdlrm
iscsistart2852480755editdlrm
iscsi_discovery52930755editdlrm
isosize147200755editdlrm
iucode-tool597360755editdlrm
iucode_tool597360755editdlrm
kbdrate186000755editdlrm
killall5311120755editdlrm
kpartx472720755editdlrm
ldattach270080755editdlrm
ldconfig3870755editdlrm
ldconfig.real12139600755editdlrm
locale-gen43980755editdlrm
logrotate1046960755editdlrm
logsave144960755editdlrm
losetup722080755editdlrm
lsmod1703520755editdlrm
luksformat34010755editdlrm
lvchange30275440755editdlrm
lvconvert30275440755editdlrm
lvcreate30275440755editdlrm
lvdisplay30275440755editdlrm
lvextend30275440755editdlrm
lvm30275440755editdlrm
lvmconfig30275440755editdlrm
lvmdiskscan30275440755editdlrm
lvmdump103120755editdlrm
lvmpolld2418640755editdlrm
lvmsadc30275440755editdlrm
lvmsar30275440755editdlrm
lvreduce30275440755editdlrm
lvremove30275440755editdlrm
lvrename30275440755editdlrm
lvresize30275440755editdlrm
lvs30275440755editdlrm
lvscan30275440755editdlrm
make-bcache229120755editdlrm
make-ssl-cert68120755editdlrm
mdadm6157440755editdlrm
mdmon2646400755editdlrm
mii-tool273760755editdlrm
mkdosfs520480755editdlrm
mke2fs1337520755editdlrm
mkfs147200755editdlrm
mkfs.bfs229120755editdlrm
mkfs.btrfs4825600755editdlrm
mkfs.cramfs351440755editdlrm
mkfs.ext21337520755editdlrm
mkfs.ext31337520755editdlrm
mkfs.ext41337520755editdlrm
mkfs.fat520480755editdlrm
mkfs.minix434080755editdlrm
mkfs.msdos520480755editdlrm
mkfs.ntfs720720755editdlrm
mkfs.vfat520480755editdlrm
mkfs.xfs3919600755editdlrm
mkhomedir_helper227040755editdlrm
mkinitramfs124530755editdlrm
mklost+found146480755editdlrm
mkntfs720720755editdlrm
mkswap474960755editdlrm
ModemManager21942400755editdlrm
modinfo1703520755editdlrm
modprobe1703520755editdlrm
mount.fuse187360755editdlrm
mount.fuse3187360755editdlrm
mount.lowntfs-3g1177360755editdlrm
mount.ntfs1628240755editdlrm
mount.ntfs-3g1628240755editdlrm
mpathpersist318000755editdlrm
multipath349680755editdlrm
multipathd1374800755editdlrm
mysqld556047280755editdlrm
nameif148240755editdlrm
needrestart396580755editdlrm
netplan7980755editdlrm
netwatch3376640755editdlrm
newusers765200755editdlrm
nfnl_osf187360755editdlrm
nft268560755editdlrm
nginx12405520755editdlrm
nologin146400755editdlrm
ntfsclone515920755editdlrm
ntfscp352000755editdlrm
ntfslabel229120755editdlrm
ntfsresize638880755editdlrm
ntfsundelete515920755editdlrm
on_ac_power37880755editdlrm
overlayroot-chroot25100755editdlrm
ownership147920755editdlrm
pam-auth-update209920755editdlrm
pam_extrausers_chkpwd226802755editdlrm
pam_extrausers_update308720755editdlrm
pam_getenv28900755editdlrm
pam_timestamp_check144880755editdlrm
paperconfig41700755editdlrm
parted884720755editdlrm
partprobe147200755editdlrm
pdata_tools13896080755editdlrm
php-fpm8.155534480755editdlrm
php-fpm8.357803040755editdlrm
php-fpm8.5102804400755editdlrm
phpdismod72780755editdlrm
phpenmod72780755editdlrm
phpquery63890755editdlrm
pivot_root147200755editdlrm
plipconfig146480755editdlrm
plymouthd1541680755editdlrm
postalias228320755editdlrm
postcat229040755editdlrm
postconf1882080755editdlrm
postdrop229602555editdlrm
postfix188160755editdlrm
postfix-add-filter49540755editdlrm
postfix-add-policy38600755editdlrm
postfix-collate29420755editdlrm
postkick146400755editdlrm
postlock146400755editdlrm
postlog148000755editdlrm
postmap228320755editdlrm
postmulti314240755editdlrm
postqueue229122555editdlrm
postsuper313280755editdlrm
posttls-finger434000755editdlrm
poweroff11198560755editdlrm
pvchange30275440755editdlrm
pvck30275440755editdlrm
pvcreate30275440755editdlrm
pvdisplay30275440755editdlrm
pvmove30275440755editdlrm
pvremove30275440755editdlrm
pvresize30275440755editdlrm
pvs30275440755editdlrm
pvscan30275440755editdlrm
pwck513360755editdlrm
pwconv471120755editdlrm
pwunconv430160755editdlrm
qmqp-sink187360755editdlrm
qmqp-source228480755editdlrm
qshape128490755editdlrm
rarp331040755editdlrm
readprofile229440755editdlrm
reboot11198560755editdlrm
remove-shell10990755editdlrm
resize2fs678960755editdlrm
rmail187360755editdlrm
rmmod1703520755editdlrm
rmt599760755editdlrm
rmt-tar599760755editdlrm
route658080755editdlrm
rsyslogd7856000755editdlrm
rtacct289920755editdlrm
rtcwake352000755editdlrm
rtmon925600755editdlrm
runlevel11198560755editdlrm
runuser556800755editdlrm
sendmail311840755editdlrm
service90970755editdlrm
setcap146480755editdlrm
setvesablank145680755editdlrm
setvtrgb146320755editdlrm
sfdisk1048320755editdlrm
sgdisk1663840755editdlrm
shadowconfig8850755editdlrm
shutdown11198560755editdlrm
slattach369440755editdlrm
smtp-sink361120755editdlrm
smtp-source310480755editdlrm
split-logfile24150755editdlrm
sshd9212880755editdlrm
start-stop-daemon484880755editdlrm
statnetd350320755editdlrm
sudo_logsrvd2049040755editdlrm
sudo_sendlog1099120755editdlrm
sulogin433920755editdlrm
swaplabel188160755editdlrm
swapoff229120755editdlrm
swapon433920755editdlrm
switch_root229120755editdlrm
sysctl309600755editdlrm
tarcat9360755editdlrm
tc6288160755editdlrm
tcpblast354560755editdlrm
telinit11198560755editdlrm
thermald5679120755editdlrm
thin_check13896080755editdlrm
thin_delta13896080755editdlrm
thin_dump13896080755editdlrm
thin_ls13896080755editdlrm
thin_metadata_size13896080755editdlrm
thin_repair13896080755editdlrm
thin_restore13896080755editdlrm
thin_rmap13896080755editdlrm
thin_trim13896080755editdlrm
tipc926080755editdlrm
trafshow1305920755editdlrm
tune2fs1050160755editdlrm
tzconfig1060755editdlrm
udpblast354560755editdlrm
ufw49380755editdlrm
umount.udisks2146400755editdlrm
unix_chkpwd267762755editdlrm
unix_update308720755editdlrm
update-ca-certificates54180755editdlrm
update-grub640755editdlrm
update-grub-gfxpayload3010755editdlrm
update-grub2640755editdlrm
update-gsfontmap4700755editdlrm
update-info-dir17000755editdlrm
update-initramfs69060755editdlrm
update-locale30630755editdlrm
update-mime96130755editdlrm
update-passwd353920755editdlrm
update-pciids17530755editdlrm
update-rc.d173240755editdlrm
update-secureboot-policy76050755editdlrm
update-shells38060755editdlrm
upgrade-from-grub-legacy15960755editdlrm
usbmuxd886800755editdlrm
usb_modeswitch610960755editdlrm
usb_modeswitch_dispatcher274180755editdlrm
useradd1307200755editdlrm
userdel889360755editdlrm
usermod1264240755editdlrm
uuidd315920755editdlrm
validlocale17730755editdlrm
vcstime144880755editdlrm
vdpa312960755editdlrm
veritysetup448080755editdlrm
vgcfgbackup30275440755editdlrm
vgcfgrestore30275440755editdlrm
vgchange30275440755editdlrm
vgck30275440755editdlrm
vgconvert30275440755editdlrm
vgcreate30275440755editdlrm
vgdisplay30275440755editdlrm
vgexport30275440755editdlrm
vgextend30275440755editdlrm
vgimport30275440755editdlrm
vgimportclone30275440755editdlrm
vgmerge30275440755editdlrm
vgmknodes30275440755editdlrm
vgreduce30275440755editdlrm
vgremove30275440755editdlrm
vgrename30275440755editdlrm
vgs30275440755editdlrm
vgscan30275440755editdlrm
vgsplit30275440755editdlrm
vigr578880755editdlrm
vipw578880755editdlrm
visudo2250640755editdlrm
vpddecode149280755editdlrm
wipefs392960755editdlrm
xfs_admin14070755editdlrm
xfs_bmap6950755editdlrm
xfs_copy844640755editdlrm
xfs_db6680960755editdlrm
xfs_estimate145040755editdlrm
xfs_freeze8000755editdlrm
xfs_fsr431920755editdlrm
xfs_growfs392000755editdlrm
xfs_info12940755editdlrm
xfs_io2043440755editdlrm
xfs_logprint802080755editdlrm
xfs_mdrestore268000755editdlrm
xfs_metadump7820755editdlrm
xfs_mkfile10400755editdlrm
xfs_ncheck6850755editdlrm
xfs_quota923280755editdlrm
xfs_repair6137680755editdlrm
xfs_rtcp185840755editdlrm
xfs_scrub1088160755editdlrm
xfs_scrub_all60060755editdlrm
xfs_spaceman433200755editdlrm
xtables-legacy-multi992720755editdlrm
xtables-monitor2242960755editdlrm
xtables-nft-multi2242960755editdlrm
zerofree144880755editdlrm
zic638160755editdlrm
zramctl558240755editdlrm
Edit: /usr/sbin/dhclient-script (16304B)
#!/bin/sh # Explicitly set the PATH to that of ENV_SUPATH in /etc/login.defs and unset # various other variables. We need to do this so /sbin/dhclient cannot abuse # the environment to escape AppArmor confinement via this script # (LP: #1045986). This can be removed once AppArmor supports environment # filtering (LP: #1045985) export PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin export ENV= export BASH_ENV= export CDPATH= export GLOBIGNORE= export BASH_XTRACEFD= # dhclient-script for Linux. Dan Halbert, March, 1997. # Updated for Linux 2.[12] by Brian J. Murrell, January 1999. # Modified for Debian. Matt Zimmerman and Eloy Paris, December 2003 # Modified to remove useless tests for antiquated kernel versions that # this doesn't even work with anyway, and introduces a dependency on /usr # being mounted, which causes cosmetic errors on hosts that NFS mount /usr # Andrew Pollock, February 2005 # Modified to work on point-to-point links. Andrew Pollock, June 2005 # Modified to support passing the parameters called with to the hooks. Andrew Pollock, November 2005 # The alias handling in here probably still sucks. -mdz # log an error. error() { logger -p daemon.err "$@"; } # wait for given file to be writable wait_for_rw() { local file=$1 # Find out whether we are going to mount / rw exec 9>&0 &9 9>&- # Wait for $file to become writable if [ "$rootmode" = "rw" ]; then while ! { : >> "$file"; } 2>/dev/null; do sleep 0.1 done fi } # update /etc/resolv.conf based on received values make_resolv_conf() { local new_resolv_conf # DHCPv4 if [ -n "$new_domain_search" ] || [ -n "$new_domain_name" ] || [ -n "$new_domain_name_servers" ]; then resolv_conf=$(readlink -f "/etc/resolv.conf" 2>/dev/null) || resolv_conf="/etc/resolv.conf" new_resolv_conf="${resolv_conf}.dhclient-new.$$" wait_for_rw "$new_resolv_conf" rm -f $new_resolv_conf if [ -n "$new_domain_name" ]; then echo domain ${new_domain_name%% *} >>$new_resolv_conf fi 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 "search ${new_domain_search}" >> $new_resolv_conf elif [ -n "$new_domain_name" ]; then echo "search ${new_domain_name}" >> $new_resolv_conf fi if [ -n "$new_domain_name_servers" ]; then for nameserver in $new_domain_name_servers; do echo nameserver $nameserver >>$new_resolv_conf done else # keep 'old' nameservers sed -n /^\w*[Nn][Aa][Mm][Ee][Ss][Ee][Rr][Vv][Ee][Rr]/p $resolv_conf >>$new_resolv_conf fi if [ -f $resolv_conf ]; then chown --reference=$resolv_conf $new_resolv_conf chmod --reference=$resolv_conf $new_resolv_conf fi mv -f $new_resolv_conf $resolv_conf # DHCPv6 elif [ -n "$new_dhcp6_domain_search" ] || [ -n "$new_dhcp6_name_servers" ]; then resolv_conf=$(readlink -f "/etc/resolv.conf" 2>/dev/null) || resolv_conf="/etc/resolv.conf" new_resolv_conf="${resolv_conf}.dhclient-new.$$" wait_for_rw "$new_resolv_conf" rm -f $new_resolv_conf if [ -n "$new_dhcp6_domain_search" ]; then echo "search ${new_dhcp6_domain_search}" >> $new_resolv_conf fi if [ -n "$new_dhcp6_name_servers" ]; then for nameserver in $new_dhcp6_name_servers; do # append %interface to link-local-address nameservers if [ "${nameserver##fe80::}" != "$nameserver" ] || [ "${nameserver##FE80::}" != "$nameserver" ]; then nameserver="${nameserver}%${interface}" fi echo nameserver $nameserver >>$new_resolv_conf done else # keep 'old' nameservers sed -n /^\w*[Nn][Aa][Mm][Ee][Ss][Ee][Rr][Vv][Ee][Rr]/p $resolv_conf >>$new_resolv_conf fi if [ -f $resolv_conf ]; then chown --reference=$resolv_conf $new_resolv_conf chmod --reference=$resolv_conf $new_resolv_conf fi mv -f $new_resolv_conf $resolv_conf fi } # set host name set_hostname() { if [ -n "$new_host_name" ]; then local current_hostname=$(hostname) # current host name is empty, '(none)' or 'localhost' or differs from new one from DHCP if [ -z "$current_hostname" ] || [ "$current_hostname" = '(none)' ] || [ "$current_hostname" = 'localhost' ] || [ "$current_hostname" = "$old_host_name" ]; then if [ "$new_host_name" != "$current_host_name" ]; then hostname "$new_host_name" fi fi fi } # set the link up and wait for ipv6 link local dad to finish ipv6_link_up_and_dad() { local dev=$1 delay=${2:-0.1} attempts=${3:-60} ip link set up dev "$dev" || { error "$dev: failed to set link up"; return 1; } local n=0 while :; do n=$((n+1)) # note: busybox ip does not understand 'tentative' as input # so we cannot just use the tentative flag and check for empty out=$(ip -6 -o address show dev "$dev" scope link) || { error "$dev: checking for link-local addresses failed"; return 1 } # another note: the output may be empty if the link local tentative addr # isn't up just yet, so we need to make sure there is at least one 'inet6' # match before returning success. We need to keep checking for both # 'tentative' case and default (no inet6 address) case. (LP: #1718568) # Don't reorder tentative/inet6 - we need to check for tentative first. case " $out " in *\ dadfailed\ *) error "$dev: ipv6 dad failed." return 1;; *\ tentative\ *) :;; *\ inet6\ *) return 0;; *) :;; esac [ $n -lt $attempts ] || { error "$dev: time out waiting for permanent link-local address" return 1; } sleep $delay done } # run given script run_hook() { local script="$1" local exit_status=0 if [ -f $script ]; then . $script exit_status=$? fi if [ -n "$exit_status" ] && [ "$exit_status" -ne 0 ]; then logger -p daemon.err "$script returned non-zero exit status $exit_status" fi return $exit_status } # run scripts in given directory run_hookdir() { local dir="$1" local exit_status=0 if [ -d "$dir" ]; then for script in $(run-parts --list $dir); do run_hook $script exit_status=$((exit_status|$?)) done fi return $exit_status } # Must be used on exit. Invokes the local dhcp client exit hooks, if any. exit_with_hooks() { local exit_status=$1 # Source the documented exit-hook script, if it exists if ! run_hook /etc/dhcp/dhclient-exit-hooks; then exit_status=$? fi # Now run scripts in the Debian-specific directory. if ! run_hookdir /etc/dhcp/dhclient-exit-hooks.d; then exit_status=$? fi exit $exit_status } # The 576 MTU is only used for X.25 and dialup connections # where the admin wants low latency. Such a low MTU can cause # problems with UDP traffic, among other things. As such, # disallow MTUs from 576 and below by default, so that broken # MTUs are ignored, but higher stuff is allowed (1492, 1500, etc). if [ -z "$new_interface_mtu" ] || [ "$new_interface_mtu" -le 576 ]; then new_interface_mtu='' fi # The action starts here # Invoke the local dhcp client enter hooks, if they exist. run_hook /etc/dhcp/dhclient-enter-hooks run_hookdir /etc/dhcp/dhclient-enter-hooks.d # Execute the operation case "$reason" in ### DHCPv4 Handlers MEDIUM|ARPCHECK|ARPSEND) # Do nothing ;; PREINIT) # The DHCP client is requesting that an interface be # configured as required in order to send packets prior to # receiving an actual address. - dhclient-script(8) # ensure interface is up ip link set dev ${interface} up if [ -n "$alias_ip_address" ]; then # flush alias IP from interface ip -4 addr flush dev ${interface} label ${interface}:0 fi ;; BOUND|RENEW|REBIND|REBOOT) set_hostname if [ -n "$old_ip_address" ] && [ -n "$alias_ip_address" ] && [ "$alias_ip_address" != "$old_ip_address" ]; then # alias IP may have changed => flush it ip -4 addr flush dev ${interface} label ${interface}:0 fi if [ -n "$old_ip_address" ] && [ "$old_ip_address" != "$new_ip_address" ]; then # leased IP has changed => flush it ip -4 addr flush dev ${interface} label ${interface} fi if [ -z "$old_ip_address" ] || [ "$old_ip_address" != "$new_ip_address" ] || [ "$reason" = "BOUND" ] || [ "$reason" = "REBOOT" ]; then # new IP has been leased or leased IP changed => set it ip -4 addr add ${new_ip_address}${new_subnet_mask:+/$new_subnet_mask} \ ${new_broadcast_address:+broadcast $new_broadcast_address} \ ${new_dhcp_lease_time:+valid_lft $new_dhcp_lease_time} \ ${new_dhcp_lease_time:+preferred_lft $new_dhcp_lease_time} \ dev ${interface} label ${interface} if [ -n "$new_interface_mtu" ]; then # set MTU ip link set dev ${interface} mtu ${new_interface_mtu} fi # if we have $new_rfc3442_classless_static_routes then we have to # ignore $new_routers entirely if [ ! "$new_rfc3442_classless_static_routes" ]; then # set if_metric if IF_METRIC is set or there's more than one router if_metric="$IF_METRIC" if [ "${new_routers%% *}" != "${new_routers}" ]; then if_metric=${if_metric:-1} fi for router in $new_routers; do if [ "$new_subnet_mask" = "255.255.255.255" ]; then # point-to-point connection => set explicit route ip -4 route add ${router} dev $interface >/dev/null 2>&1 fi # set default route ip -4 route add default via ${router} dev ${interface} \ ${if_metric:+metric $if_metric} >/dev/null 2>&1 if [ -n "$if_metric" ]; then if_metric=$((if_metric+1)) fi done fi else # RENEW||REBIND ip -4 addr change ${new_ip_address}${new_subnet_mask:+/$new_subnet_mask} \ ${new_broadcast_address:+broadcast $new_broadcast_address} \ ${new_dhcp_lease_time:+valid_lft $new_dhcp_lease_time} \ ${new_dhcp_lease_time:+preferred_lft $new_dhcp_lease_time} \ dev ${interface} label ${interface} fi if [ -n "$alias_ip_address" ] && [ "$new_ip_address" != "$alias_ip_address" ]; then # separate alias IP given, which may have changed # => flush it, set it & add host route to it ip -4 addr flush dev ${interface} label ${interface}:0 ip -4 addr add ${alias_ip_address}${alias_subnet_mask:+/$alias_subnet_mask} \ dev ${interface} label ${interface}:0 ip -4 route add ${alias_ip_address} dev ${interface} >/dev/null 2>&1 fi # update /etc/resolv.conf make_resolv_conf ;; EXPIRE|FAIL|RELEASE|STOP) if [ -n "$alias_ip_address" ]; then # flush alias IP ip -4 addr flush dev ${interface} label ${interface}:0 fi if [ -n "$old_ip_address" ]; then # flush leased IP ip -4 addr flush dev ${interface} label ${interface} fi if [ -n "$alias_ip_address" ]; then # alias IP given => set it & add host route to it ip -4 addr add ${alias_ip_address}${alias_subnet_mask:+/$alias_subnet_mask} \ dev ${interface} label ${interface}:0 ip -4 route add ${alias_ip_address} dev ${interface} >/dev/null 2>&1 fi ;; TIMEOUT) if [ -n "$alias_ip_address" ]; then # flush alias IP ip -4 addr flush dev ${interface} label ${interface}:0 fi # set IP from recorded lease ip -4 addr add ${new_ip_address}${new_subnet_mask:+/$new_subnet_mask} \ ${new_broadcast_address:+broadcast $new_broadcast_address} \ ${new_dhcp_lease_time:+valid_lft $new_dhcp_lease_time} \ ${new_dhcp_lease_time:+preferred_lft $new_dhcp_lease_time} \ dev ${interface} label ${interface} if [ -n "$new_interface_mtu" ]; then # set MTU ip link set dev ${interface} mtu ${new_interface_mtu} fi # if there is no router recorded in the lease or the 1st router answers pings if [ -z "$new_routers" ] || ping -q -c 1 "${new_routers%% *}"; then # if we have $new_rfc3442_classless_static_routes then we have to # ignore $new_routers entirely if [ ! "$new_rfc3442_classless_static_routes" ]; then if [ -n "$alias_ip_address" ] && [ "$new_ip_address" != "$alias_ip_address" ]; then # separate alias IP given => set up the alias IP & add host route to it ip -4 addr add ${alias_ip_address}${alias_subnet_mask:+/$alias_subnet_mask} \ dev ${interface} label ${interface}:0 ip -4 route add ${alias_ip_address} dev ${interface} >/dev/null 2>&1 fi # set if_metric if IF_METRIC is set or there's more than one router if_metric="$IF_METRIC" if [ "${new_routers%% *}" != "${new_routers}" ]; then if_metric=${if_metric:-1} fi # set default route for router in $new_routers; do ip -4 route add default via ${router} dev ${interface} \ ${if_metric:+metric $if_metric} >/dev/null 2>&1 if [ -n "$if_metric" ]; then if_metric=$((if_metric+1)) fi done fi # update /etc/resolv.conf make_resolv_conf else # flush all IPs from interface ip -4 addr flush dev ${interface} exit_with_hooks 2 fi ;; ### DHCPv6 Handlers # TODO handle prefix change: ?based on ${old_ip6_prefix} and ${new_ip6_prefix}? PREINIT6) # ensure interface is up ipv6_link_up_and_dad "$interface" # flush any stale global permanent IPs from interface ip -6 addr flush dev ${interface} scope global permanent ;; BOUND6|RENEW6|REBIND6) if [ "${new_ip6_address}" ]; then # set leased IP ip -6 addr add ${new_ip6_address} \ dev ${interface} scope global fi # update /etc/resolv.conf if [ "${reason}" = BOUND6 ] || [ "${new_dhcp6_name_servers}" != "${old_dhcp6_name_servers}" ] || [ "${new_dhcp6_domain_search}" != "${old_dhcp6_domain_search}" ]; then make_resolv_conf fi ;; DEPREF6) # set preferred lifetime of leased IP to 0 ip -6 addr change ${cur_ip6_address} \ dev ${interface} scope global preferred_lft 0 ;; EXPIRE6|RELEASE6|STOP6) if [ -z "${old_ip6_address}" ]; then exit_with_hooks 2 fi # delete leased IP ip -6 addr del ${old_ip6_address} \ dev ${interface} ;; esac exit_with_hooks 0