diff options
author | Scott Ullrich <sullrich@sullrich-MacBookPro.local> | 2009-03-18 19:04:01 -0400 |
---|---|---|
committer | Scott Ullrich <sullrich@sullrich-MacBookPro.local> | 2009-03-18 19:04:24 -0400 |
commit | 2468ae7620fdfd69b9282787e09c17cccad78281 (patch) | |
tree | 65b85c706c24ee17e7eef808a225359dcc9b3880 /etc/inc/gwlb.inc | |
parent | 2ccad09a1196d88baa587f7017a7f1a05fe37e1c (diff) | |
download | pfsense-2468ae7620fdfd69b9282787e09c17cccad78281.zip pfsense-2468ae7620fdfd69b9282787e09c17cccad78281.tar.gz |
Update gateway group gateway IP for dhcp interface wan interfaces.
Diffstat (limited to 'etc/inc/gwlb.inc')
-rw-r--r-- | etc/inc/gwlb.inc | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/etc/inc/gwlb.inc b/etc/inc/gwlb.inc index 63777e0..eda38de 100644 --- a/etc/inc/gwlb.inc +++ b/etc/inc/gwlb.inc @@ -381,5 +381,20 @@ function return_gateway_groups_array() { return($gateway_groups_array); } +/* Update DHCP WAN Interface ip address in gateway group item */ +function dhclient_update_gateway_groups_defaultroute($interface = "wan") { + global $config, $g; + foreach($config['gateways']['gateway_item'] as & $gw) { + if($gw['interface'] == $interface) { + $current_gw = get_interface_gateway($interface); + if($gw['gateway'] <> $current_gw) { + $gw['gateway'] = $current_gw; + $changed = true; + } + } + } + if($changed && $current_gw) + write_config("Updating gateway group gateway for $interface - new gateway is $current_gw"); +} -?> +?>
\ No newline at end of file |