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 | |
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')
-rw-r--r-- | etc/inc/gwlb.inc | 17 | ||||
-rwxr-xr-x | etc/rc.newwanip | 3 |
2 files changed, 19 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 diff --git a/etc/rc.newwanip b/etc/rc.newwanip index 5f654b0..5918084 100755 --- a/etc/rc.newwanip +++ b/etc/rc.newwanip @@ -106,6 +106,9 @@ filter_configure(); /* reload graphing functions */ enable_rrd_graphing(); +/* This is DHCP, update the gateway group items default gateway */ +update_gateway_groups_defaultroute_dhclient($interface); + /* restart packages */ if($old_ip <> "") { if($old_ip <> $curwanip) { |