diff options
author | Seth Mos <seth.mos@xs4all.nl> | 2007-09-01 18:30:20 +0000 |
---|---|---|
committer | Seth Mos <seth.mos@xs4all.nl> | 2007-09-01 18:30:20 +0000 |
commit | bc40d758bea5ba6be700bd83fd9a7ae643378faa (patch) | |
tree | b60c4130ee7b5e9cfdcae080538bbc6cc8672ce7 /etc/inc/interfaces.inc | |
parent | c1abd446e2a96ad48a3d477d0f24ff5bbd8ae097 (diff) | |
download | pfsense-bc40d758bea5ba6be700bd83fd9a7ae643378faa.zip pfsense-bc40d758bea5ba6be700bd83fd9a7ae643378faa.tar.gz |
Create a management subnet on a wan interface if the interface is DHCP.
Create automatic nat rules for the management subnet.
Make the automatic nat rules always use the interface address.
Allow entry of these subnets on the interfaces page.
Diffstat (limited to 'etc/inc/interfaces.inc')
-rw-r--r-- | etc/inc/interfaces.inc | 36 |
1 files changed, 35 insertions, 1 deletions
diff --git a/etc/inc/interfaces.inc b/etc/inc/interfaces.inc index c77eeb6..9fb01fe 100644 --- a/etc/inc/interfaces.inc +++ b/etc/inc/interfaces.inc @@ -984,6 +984,17 @@ interface "{$optif}" { EOD; +if(is_ipaddr($optcfg['alias-address'])) { + $subnetmask = gen_subnet_mask($optcfg['alias-subnet']); + $dhclientconf .= <<<EOD +alias { + interface "{$optif}"; + fixed-address {$optcfg['alias-address']}; + option subnet-mask {$subnetmask}; +} + +EOD; +} fwrite($fd, $dhclientconf); fclose($fd); @@ -1028,6 +1039,18 @@ interface "{$realinterface}" { EOD; +if(is_ipaddr($optcfg['alias-address'])) { + $subnetmask = gen_subnet_mask($optcfg['alias-subnet']); + $dhclientconf .= <<<EOD +alias { + interface "{$optif}"; + fixed-address {$optcfg['alias-address']}; + option subnet-mask {$subnetmask}; +} + +EOD; +} + fwrite($fd, $dhclientconf); fclose($fd); @@ -1075,6 +1098,17 @@ interface "{$wancfg['if']}" { EOD; +if(is_ipaddr($wancfg['alias-address'])) { + $subnetmask = gen_subnet_mask($wancfg['alias-subnet']); + $dhclientconf .= <<<EOD +alias { + interface "{$wancfg['if']}"; + fixed-address {$wancfg['alias-address']}; + option subnet-mask {$subnetmask}; +} + +EOD; +} fwrite($fd, $dhclientconf); fclose($fd); @@ -1659,4 +1693,4 @@ function get_interface_mac($interface) { return $mac; } -?>
\ No newline at end of file +?> |