Skip to content

Commit

Permalink
interfaces: temporary workaround to re-apply DHCP default route after…
Browse files Browse the repository at this point in the history
… "something else" dropped it

Also add debugging information in dhclient-script.  For some reason I'm suspecting the kernel
dropping the route after modifying address information...

PR: #6338
PR: https://forum.opnsense.org/index.php?topic=32347.0
  • Loading branch information
AdSchellevis authored and fichtner committed Feb 21, 2023
1 parent 5d77a44 commit 26d26e2
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/etc/rc.newwanip
Expand Up @@ -84,6 +84,7 @@ system_hosts_generate();
$cacheip = trim(@file_get_contents($cacheip_file));
if ($ip == $cacheip) {
log_msg("No IP change detected for {$interface_descr}[{$interface}]", LOG_INFO);
system_routing_configure(false, $interface); /* XXX workaround for missing default route */
return;
}

Expand Down
8 changes: 8 additions & 0 deletions src/opnsense/scripts/interfaces/dhclient-script
Expand Up @@ -280,12 +280,18 @@ ARPCHECK|ARPSEND)
BOUND|RENEW|REBIND|REBOOT)
check_hostname
changes="no"
$LOGGER "DEBUG entering with $reason"
$LOGGER "DEBUG old_ip_address: $old_ip_address"
$LOGGER "DEBUG new_ip_address: $new_ip_address"
$LOGGER "DEBUG alias_ip_address: $alias_ip_address"
if [ -n "$old_ip_address" ]; then
if [ -n "$alias_ip_address" -a "$old_ip_address" != "$alias_ip_address" ]; then
$LOGGER "DEBUG calling delete_old_alias"
delete_old_alias
changes="yes"
fi
if [ "$old_ip_address" != "$new_ip_address" ]; then
$LOGGER "DEBUG calling delete_old_address/delete_old_routes"
delete_old_address
delete_old_routes
changes="yes"
Expand All @@ -295,11 +301,13 @@ BOUND|RENEW|REBIND|REBOOT)
[ "$reason" = REBOOT ] || \
[ -z "$old_ip_address" ] || \
[ "$old_ip_address" != "$new_ip_address" ]; then
$LOGGER "DEBUG calling add_new_address/add_new_routes"
add_new_address
add_new_routes
changes="yes"
fi
if [ -n "$alias_ip_address" -a "$new_ip_address" != "$alias_ip_address" ]; then
$LOGGER "DEBUG calling add_new_alias"
add_new_alias
changes="yes"
fi
Expand Down

0 comments on commit 26d26e2

Please sign in to comment.