summaryrefslogtreecommitdiffstats
path: root/etc
diff options
context:
space:
mode:
authorScott Ullrich <sullrich@pfsense.org>2005-08-02 20:17:12 +0000
committerScott Ullrich <sullrich@pfsense.org>2005-08-02 20:17:12 +0000
commita4d9f914534696d684d913a79a73643db81c652a (patch)
tree60e2a32c34e4e502dad0247c511e8c9291fea2d5 /etc
parentf0dcff6fa875d8d02fca6b72817e503dca8fee9f (diff)
downloadpfsense-a4d9f914534696d684d913a79a73643db81c652a.zip
pfsense-a4d9f914534696d684d913a79a73643db81c652a.tar.gz
Add LAN bridging option
Diffstat (limited to 'etc')
-rw-r--r--etc/inc/interfaces.inc18
1 files changed, 18 insertions, 0 deletions
diff --git a/etc/inc/interfaces.inc b/etc/inc/interfaces.inc
index 3c00050..de4a915 100644
--- a/etc/inc/interfaces.inc
+++ b/etc/inc/interfaces.inc
@@ -111,6 +111,24 @@ function interfaces_lan_configure() {
file_notice("MAC Address altered", "The INVALID MAC address (ff:ff:ff:ff:ff:ff) on interface {$lancfg['if']} has been automatically replaced with {$random_mac}", "Interfaces");
}
}
+
+ /* bridged? */
+ if ($optcfg['bridge']) {
+ mwexec("/sbin/ifconfig " . escapeshellarg($optcfg['if']) . " delete up");
+ /* use open/netBSD style bridge */
+ mwexec("/sbin/ifconfig bridge{$bridges_total} create");
+ mwexec("/sbin/ifconfig bridge{$bridges_total} addm {$optcfg['if']} addm {$config['interfaces'][$optcfg['bridge']]['if']} up");
+ mwexec("/sbin/ifconfig bridge{$bridges_total} stp {$optcfg['if']} add {$config['interfaces'][$optcfg['bridge']]['if']}");
+
+ $fd = fopen("{$g['tmp_path']}/bridge_config_{$optcfg['if']}", "w");
+ fwrite($fd, "/sbin/ifconfig bridge{$bridges_total} create\n");
+ fwrite($fd, "/sbin/ifconfig bridge{$bridges_total} addm {$optcfg['if']} addm {$config['interfaces'][$optcfg['bridge']]['if']} up\n");
+ fwrite($fd, "/sbin/ifconfig bridge{$bridges_total} stp {$optcfg['if']} add {$config['interfaces'][$optcfg['bridge']]['if']}\n");
+ fclose($fd);
+
+ /* lets keep track of the amount of bridges initialized */
+ $bridges_total++;
+ }
/* media */
if ($lancfg['media'] || $lancfg['mediaopt']) {
OpenPOWER on IntegriCloud