diff options
author | Stephen Hemminger <shemminger@vyatta.com> | 2011-08-08 16:29:40 -0700 |
---|---|---|
committer | Stephen Hemminger <shemminger@vyatta.com> | 2011-08-08 16:29:40 -0700 |
commit | 07081897e718b22fbe2eefa1efb6e8ae06aefc16 (patch) | |
tree | 38f554e2e55e4e2ebee59979a87308941f74a7bb | |
parent | 08615f465009878cf977f27d72ad1a9d3c8fb80e (diff) | |
download | vyatta-cfg-quagga-07081897e718b22fbe2eefa1efb6e8ae06aefc16.tar.gz vyatta-cfg-quagga-07081897e718b22fbe2eefa1efb6e8ae06aefc16.zip |
bridge: allow setting mac address
Bug 7164
set interface bridge br0 mac 00:01:02:03:04:05
-rw-r--r-- | templates/interfaces/bridge/node.def | 4 | ||||
-rw-r--r-- | templates/interfaces/bridge/node.tag/mac/node.def | 4 |
2 files changed, 7 insertions, 1 deletions
diff --git a/templates/interfaces/bridge/node.def b/templates/interfaces/bridge/node.def index 9deaa0a4..c20b361c 100644 --- a/templates/interfaces/bridge/node.def +++ b/templates/interfaces/bridge/node.def @@ -6,6 +6,9 @@ val_help: <brN>; Bridge interface name syntax:expression: pattern $VAR(@) "^br[0-9]+$" ; "Must be (br0 - br999)" create: /usr/sbin/brctl addbr $VAR(@) + if [ -n "$VAR(mac/@)" ] ; then + ip li set dev $VAR(@) address $VAR(mac/@) + fi ip link set $VAR(@) up delete: if ! /opt/vyatta/sbin/vyatta-bridgegroup-depedency.pl \ @@ -15,4 +18,3 @@ delete: if ! /opt/vyatta/sbin/vyatta-bridgegroup-depedency.pl \ fi ip link set $VAR(@) down; /usr/sbin/brctl delbr $VAR(@); - diff --git a/templates/interfaces/bridge/node.tag/mac/node.def b/templates/interfaces/bridge/node.tag/mac/node.def new file mode 100644 index 00000000..5b797830 --- /dev/null +++ b/templates/interfaces/bridge/node.tag/mac/node.def @@ -0,0 +1,4 @@ +type: macaddr +help: Media Access Control (MAC) address +syntax:expression: exec "\ + /opt/vyatta/sbin/vyatta-interfaces.pl --dev $VAR(../@) --valid-mac $VAR(@)" |