diff options
author | Stephen Hemminger <stephen.hemminger@vyatta.com> | 2010-11-08 13:35:07 -0800 |
---|---|---|
committer | Stephen Hemminger <stephen.hemminger@vyatta.com> | 2010-11-08 13:58:17 -0800 |
commit | 1df58b23bac61caf78f28f549e180a3189986689 (patch) | |
tree | 55d43e25973a7373989b439e3dcc5e36602da63c /templates | |
parent | 6285193ed1a9b4cf2b85ce6d4f44942663137c48 (diff) | |
download | vyatta-cfg-quagga-1df58b23bac61caf78f28f549e180a3189986689.tar.gz vyatta-cfg-quagga-1df58b23bac61caf78f28f549e180a3189986689.zip |
Check speed and duplex settings on Ethernet interfaces
Bug 4994
Use ethtool to check for supported speed and duplex values on link.
Diffstat (limited to 'templates')
-rw-r--r-- | templates/interfaces/ethernet/node.tag/duplex/node.def | 7 | ||||
-rw-r--r-- | templates/interfaces/ethernet/node.tag/speed/node.def | 7 |
2 files changed, 8 insertions, 6 deletions
diff --git a/templates/interfaces/ethernet/node.tag/duplex/node.def b/templates/interfaces/ethernet/node.tag/duplex/node.def index 0351365f..023a8a08 100644 --- a/templates/interfaces/ethernet/node.tag/duplex/node.def +++ b/templates/interfaces/ethernet/node.tag/duplex/node.def @@ -4,9 +4,10 @@ default: "auto" syntax:expression: $VAR(@) in "auto", "half", "full"; "duplex must be auto, half or full" allowed: echo auto half full -commit:expression: ( $VAR(@) == "auto" && $VAR(../speed/@) == "auto" ) || \ - ( $VAR(@) != "auto" && $VAR(../speed/@) != "auto" ) ; \ - "if duplex is hardcoded, speed must also be hardcoded" +commit:expression: exec " \ + /opt/vyatta/sbin/vyatta-interfaces.pl --dev=$VAR(../@) \ + --check-speed $VAR(../speed/@) $VAR(@)" + update: /opt/vyatta/sbin/vyatta-interfaces.pl --dev=$VAR(../@) \ --speed-duplex $VAR(../speed/@) $VAR(@) diff --git a/templates/interfaces/ethernet/node.tag/speed/node.def b/templates/interfaces/ethernet/node.tag/speed/node.def index fbdc5893..fad248af 100644 --- a/templates/interfaces/ethernet/node.tag/speed/node.def +++ b/templates/interfaces/ethernet/node.tag/speed/node.def @@ -4,9 +4,10 @@ default: "auto" syntax:expression: $VAR(@) in "auto", "10", "100", "1000", "2500", "10000"; "Speed must be auto, 10, 100, 1000, 2500, or 10000" allowed: echo auto 10 100 1000 2500 10000 -commit:expression: ( $VAR(@) == "auto" && $VAR(../duplex/@) == "auto" ) || \ - ( $VAR(@) != "auto" && $VAR(../duplex/@) != "auto" ) ; \ - "if speed is hardcoded, duplex must also be hardcoded" +commit:expression: exec "\ + /opt/vyatta/sbin/vyatta-interfaces.pl --dev=$VAR(../@) \ + --check-speed $VAR(@) $VAR(../duplex/@)" + update: /opt/vyatta/sbin/vyatta-interfaces.pl --dev=$VAR(../@) \ --speed-duplex $VAR(@) $VAR(../duplex/@) |