Discussion:
Bridge - Sticky Interface
Mohammed Ismail
2009-10-31 09:26:14 UTC
Permalink
Using workon.sh

Cd to /etc/inc and edit interfaces.inc

Around line 300

// at this point, $bridgearray is fully populated for the number of
bridges the system requires.

// time to set them up.

for($x=0; $x <= $bridge_if_num; $x++) {

// destroy and create ifbridge interface

mwexec("/sbin/ifconfig bridge{$x} destroy");

mwexec("/sbin/ifconfig bridge{$x} create");

// log commands run for debugging in /tmp

$fd = fopen("{$g['tmp_path']}/bridge{$x}_config", "w");

fwrite($fd, "/sbin/ifconfig bridge{$x} destroy \n");

fwrite($fd, "/sbin/ifconfig bridge{$x} create \n");

$bridgecmd = "/sbin/ifconfig bridge{$x} ";

$lowestmtu = "1500";

$sticky = "sticky";

I added last line $sticky = "sticky";

Then after

// force all bridged interfaces to same MTU, the lowest common denominator

foreach ($bridgearray[$x] as $bridgeif) {

mwexec("/sbin/ifconfig {$bridgeif} mtu
{$lowestmtu}");

fwrite($fd, "/sbin/ifconfig {$bridgeif} mtu
{$lowestmtu} \n");

}

I added

// force virtual bridged interfaces to be marked sticky

foreach ($bridgearray[$x] as $bridgeif) {

mwexec("{$bridgecmd} {$sticky} {$bridgeif}");

fwrite($fd, "{$bridgecmd} {$sticky} {$bridgeif}
\n");

}

And it works only on second network card or opt interfaces not LAN

When I go to status.php

bridge0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> mtu 1500
inet 10.0.0.138 netmask 0xff000000 broadcast 10.255.255.255
inet 172.16.1.1 netmask 0xffffffff broadcast 172.16.1.1
ether 66:62:29:f3:3d:23
id 00:00:00:00:00:00 priority 32768 hellotime 2 fwddelay 15
maxage 20 holdcnt 6 proto stp maxaddr 100 timeout 1200
root id 00:00:00:00:00:00 priority 32768 ifcost 0 port 0
member: xl0 flags=143<LEARNING,DISCOVER,AUTOEDGE,AUTOPTP>
member: xl1 flags=153<LEARNING,DISCOVER,STICKY,AUTOEDGE,AUTOPTP>

xl0 = lan

xl1 = bridged to lan



sorry if I posted in the wrong place.

But I needed answers to understand is what I did works or not, that I
misunderstand what sticky interface is ?



Best regards

Mohammed .

Loading...