summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--scripts/vyatta-interfaces.pl4
-rw-r--r--templates/interfaces/loopback/node.tag/address/node.def8
2 files changed, 8 insertions, 4 deletions
diff --git a/scripts/vyatta-interfaces.pl b/scripts/vyatta-interfaces.pl
index d7ba950..36d811f 100644
--- a/scripts/vyatta-interfaces.pl
+++ b/scripts/vyatta-interfaces.pl
@@ -287,6 +287,10 @@ sub is_valid_addr {
my ($addr_net, $intf) = @_;
if ($addr_net eq "dhcp") {
+ if ($intf eq "lo") {
+ print "Error: can't use dhcp client on loopback interface\n";
+ exit 1;
+ }
if (is_dhcp_enabled($intf)) {
print "Error: dhcp already configured for $intf\n";
exit 1;
diff --git a/templates/interfaces/loopback/node.tag/address/node.def b/templates/interfaces/loopback/node.tag/address/node.def
index e597676..6cef105 100644
--- a/templates/interfaces/loopback/node.tag/address/node.def
+++ b/templates/interfaces/loopback/node.tag/address/node.def
@@ -1,6 +1,6 @@
multi:
-type: ipv4net
+type: txt
help: "Set IPv4 address and prefix for this interface"
-# TODO make sure 127.0.0.0/8 not in here.
-update: "sudo ip addr add $(@) dev $(../@)"; "Error setting address $(@) on dev $(../@)"
-delete: "sudo ip addr del $(@) dev $(../@)"; "Error deleting address $(@) on dev $(../@)"
+syntax: exec "/opt/vyatta/sbin/vyatta-interfaces.pl --valid-addr $(@) --dev $(../@)"
+update: "sudo /opt/vyatta/sbin/vyatta-interfaces.pl --eth-addr-update $(@) --dev $(../@)"; "Error setting address $(@) on dev $(../@)"
+delete: "sudo /opt/vyatta/sbin/vyatta-interfaces.pl --eth-addr-delete $(@) --dev $(../@)"; "Error deleting address $(@) on dev $(../@)"