summaryrefslogtreecommitdiff
path: root/templates
diff options
context:
space:
mode:
authorMohit Mehta <mohit.mehta@vyatta.com>2008-11-19 18:18:30 -0800
committerMohit Mehta <mohit.mehta@vyatta.com>2008-11-19 18:18:30 -0800
commit6d87be16190a658ac324488024a82961774f0ece (patch)
tree5479fb427b1aa88a074a6392db212355d6c39887 /templates
parent86322573dae188303af9d821f8c72f96d178a2ff (diff)
downloadvyatta-cfg-6d87be16190a658ac324488024a82961774f0ece.tar.gz
vyatta-cfg-6d87be16190a658ac324488024a82961774f0ece.zip
Fix Bug 3917 dhcp brings interface up for lease acquire/renew even though interface has been disabled in CLI
Diffstat (limited to 'templates')
-rw-r--r--templates/interfaces/ethernet/node.tag/address/node.def6
-rw-r--r--templates/interfaces/ethernet/node.tag/disable/node.def12
-rw-r--r--templates/interfaces/ethernet/node.tag/vif/node.tag/address/node.def6
-rw-r--r--templates/interfaces/ethernet/node.tag/vif/node.tag/disable/node.def12
4 files changed, 28 insertions, 8 deletions
diff --git a/templates/interfaces/ethernet/node.tag/address/node.def b/templates/interfaces/ethernet/node.tag/address/node.def
index d523793..5277263 100644
--- a/templates/interfaces/ethernet/node.tag/address/node.def
+++ b/templates/interfaces/ethernet/node.tag/address/node.def
@@ -2,8 +2,10 @@ multi:
type: txt
help: Set an IP address for this interface
syntax:expression: exec "/opt/vyatta/sbin/vyatta-interfaces.pl --valid-addr $VAR(@) --dev $VAR(../@)"; "Invalid IP address/prefix [$VAR(@)] for interface $VAR(../@)"
-update:expression: "sudo /opt/vyatta/sbin/vyatta-interfaces.pl --eth-addr-update $VAR(@) --dev $VAR(../@)"; "Error setting address $VAR(@) on interface $VAR(../@)"
-delete:expression: "sudo /opt/vyatta/sbin/vyatta-interfaces.pl --eth-addr-delete $VAR(@) --dev $VAR(../@)"; "Error deleting address $VAR(@) on interface $VAR(../@)"
+update:expression: "sudo /opt/vyatta/sbin/vyatta-interfaces.pl --eth-addr-update $VAR(@) --dev $VAR(../@) \
+--intf-cli-path \"interfaces ethernet $VAR(../@)\""; "Error setting address $VAR(@) on interface $VAR(../@)"
+delete:expression: "sudo /opt/vyatta/sbin/vyatta-interfaces.pl --eth-addr-delete $VAR(@) --dev $VAR(../@) \
+--intf-cli-path \"interfaces ethernet $VAR(../@)\""; "Error deleting address $VAR(@) on interface $VAR(../@)"
allowed: echo "dhcp <>"
comp_help:Possible completions:
<x.x.x.x/x> Set the IP address and prefix length
diff --git a/templates/interfaces/ethernet/node.tag/disable/node.def b/templates/interfaces/ethernet/node.tag/disable/node.def
index 54090cc..90dd582 100644
--- a/templates/interfaces/ethernet/node.tag/disable/node.def
+++ b/templates/interfaces/ethernet/node.tag/disable/node.def
@@ -1,3 +1,11 @@
help: Set interface disabled
-update:expression: "sudo ip link set $VAR(../@) down"; "Error disabling dev $VAR(../@)"
-delete:expression: "sudo ip link set $VAR(../@) up"; "Error enabling dev $VAR(../@)"
+update: /etc/netplug/linkdown.d/dhclient $VAR(../@)
+ if ! sudo ip link set $VAR(../@) down 2>/dev/null; then
+ echo "Error disabling dev $VAR(../@)"
+ /etc/netplug/linkup.d/dhclient $VAR(../@)
+ exit 1
+ fi
+delete: if ! sudo ip link set $VAR(../@) up; then
+ echo "Error enabling dev $VAR(../@)"
+ exit 1
+ fi
diff --git a/templates/interfaces/ethernet/node.tag/vif/node.tag/address/node.def b/templates/interfaces/ethernet/node.tag/vif/node.tag/address/node.def
index 625130a..0ef5583 100644
--- a/templates/interfaces/ethernet/node.tag/vif/node.tag/address/node.def
+++ b/templates/interfaces/ethernet/node.tag/vif/node.tag/address/node.def
@@ -2,8 +2,10 @@ multi:
type: txt
help: Set an IP address for this interface
syntax:expression: exec "/opt/vyatta/sbin/vyatta-interfaces.pl --valid-addr $VAR(@) --dev $VAR(../../@).$VAR(../@) "; "Invalid IP address/prefix [$VAR(@)] for interface $VAR(../../@).$VAR(../@)"
-create:expression: "sudo /opt/vyatta/sbin/vyatta-interfaces.pl --eth-addr-update $VAR(@) --dev $VAR(../../@).$VAR(../@) "; "Error setting address $VAR(@) on dev $VAR(../../@).$VAR(../@) "
-delete:expression: "sudo /opt/vyatta/sbin/vyatta-interfaces.pl --eth-addr-delete $VAR(@) --dev $VAR(../../@).$VAR(../@) "; "Error deleting address $VAR(@) on dev $VAR(../../@).$VAR(../@) "
+create:expression: "sudo /opt/vyatta/sbin/vyatta-interfaces.pl --eth-addr-update $VAR(@) --dev $VAR(../../@).$VAR(../@) \
+--intf-cli-path \"interfaces ethernet $VAR(../../@) vif $VAR(../@)\""; "Error setting address $VAR(@) on dev $VAR(../../@).$VAR(../@) "
+delete:expression: "sudo /opt/vyatta/sbin/vyatta-interfaces.pl --eth-addr-delete $VAR(@) --dev $VAR(../../@).$VAR(../@) \
+--intf-cli-path \"interfaces ethernet $VAR(../../@) vif $VAR(../@)\""; "Error deleting address $VAR(@) on dev $VAR(../../@).$VAR(../@) "
allowed: echo "dhcp <>"
comp_help:Possible completions:
<x.x.x.x/x> Set the IP address and prefix length
diff --git a/templates/interfaces/ethernet/node.tag/vif/node.tag/disable/node.def b/templates/interfaces/ethernet/node.tag/vif/node.tag/disable/node.def
index 9599de3..78b2487 100644
--- a/templates/interfaces/ethernet/node.tag/vif/node.tag/disable/node.def
+++ b/templates/interfaces/ethernet/node.tag/vif/node.tag/disable/node.def
@@ -1,3 +1,11 @@
help: Set interface disabled
-update:expression: "sudo ip link set $VAR(../../@).$VAR(../@) down"; "Error disabling dev $VAR(../../@).$VAR(../@)"
-delete:expression: "sudo ip link set $VAR(../../@).$VAR(../@) up"; "Error enabling dev $VAR(../../@).$VAR(../@)"
+update: /etc/netplug/linkdown.d/dhclient $VAR(../../@).$VAR(../@)
+ if ! sudo ip link set $VAR(../../@).$VAR(../@) down 2>/dev/null; then
+ echo "Error disabling dev $VAR(../../@).$VAR(../@)"
+ /etc/netplug/linkup.d/dhclient $VAR(../../@).$VAR(../@)
+ exit 1
+ fi
+delete: if ! sudo ip link set $VAR(../../@).$VAR(../@) up; then
+ echo "Error enabling dev $VAR(../../@).$VAR(../@)"
+ exit 1
+ fi