diff options
author | Stig Thormodsrud <stig@vyatta.com> | 2008-02-15 19:42:42 -0800 |
---|---|---|
committer | Stig Thormodsrud <stig@vyatta.com> | 2008-02-15 19:42:42 -0800 |
commit | 5e3f42d5aaba08a096744dbf9a24f7ab60d91b8f (patch) | |
tree | 46397d43cdfd3db600ddb88dc477e74744f6b98c /templates | |
parent | 48e5ad4a4b4d0d24e7a83b8c077353be5cdd315e (diff) | |
download | vyatta-cfg-5e3f42d5aaba08a096744dbf9a24f7ab60d91b8f.tar.gz vyatta-cfg-5e3f42d5aaba08a096744dbf9a24f7ab60d91b8f.zip |
Fix 2826 Failure when setting mac address on interface
Diffstat (limited to 'templates')
-rw-r--r-- | templates/interfaces/ethernet/node.tag/mac/node.def | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/templates/interfaces/ethernet/node.tag/mac/node.def b/templates/interfaces/ethernet/node.tag/mac/node.def index 909aed8..e556743 100644 --- a/templates/interfaces/ethernet/node.tag/mac/node.def +++ b/templates/interfaces/ethernet/node.tag/mac/node.def @@ -1,4 +1,14 @@ type: macaddr help: Set the MAC address of this interface -update:expression: "sudo ip link set $VAR(../@) address $VAR(@)"; "Error setting MAC address on dev $VAR(../@)" -delete:expression: "sudo ip link set $VAR(../@) address $VAR(../hw-id/@)"; "Error setting MAC address on dev $VAR(../@) to $VAR(../hw-id/@)" + +update:expression: "sudo sh -c \"ip link set $VAR(../@) down && \ + ip link set $VAR(../@) address $VAR(@) && \ + ip link set $VAR(../@) up; \" "; \ + "Error setting MAC address on dev $VAR(../@)" + +delete:expression: "sudo sh -c \"ip link set $VAR(../@) down && \ + ip link set $VAR(../@) address \ + $VAR(../hw-id/@) && \ + ip link set $VAR(../@) up;\" "; \ + "Error resetting MAC address on dev $VAR(../@) to \ + $VAR(../hw-id/@)" |