diff options
author | Tom Grennan <tgrennan@vyatta.com> | 2008-01-03 18:11:50 -0800 |
---|---|---|
committer | Tom Grennan <tgrennan@vyatta.com> | 2008-01-03 18:11:50 -0800 |
commit | ad7513053936b4712677ee547a13f2b07b49fbef (patch) | |
tree | b4fd18fd6349b798c9741dd8d83a70d5d637000c /templates | |
parent | 54a57f5ffc98df1097d4d3b7b3e4e0cffe27eb12 (diff) | |
parent | ea4c396e33bf34cb8272daa2e1b2177a962cffb1 (diff) | |
download | vyatta-cfg-system-ad7513053936b4712677ee547a13f2b07b49fbef.tar.gz vyatta-cfg-system-ad7513053936b4712677ee547a13f2b07b49fbef.zip |
Merge branch 'glendale' of http://suva.vyatta.com/vyatta-cfg-system into glendale
Diffstat (limited to 'templates')
12 files changed, 56 insertions, 6 deletions
diff --git a/templates/interfaces/tunnel/node.def b/templates/interfaces/tunnel/node.def new file mode 100644 index 00000000..8d8cc029 --- /dev/null +++ b/templates/interfaces/tunnel/node.def @@ -0,0 +1,11 @@ +tag: +type: txt +help: "Configure a tunnel interface" +syntax: $(@) in "tun0", "tun1", "tun2", "tun3", "tun4", "tun5", "tun6", "tun7", "tun8", "tun9" ; "Must be (tun0 - tun9)" +commit: $(./local-ip/) != "" ; "Must configure the tunnel local-ip" +commit: $(./remote-ip/) != "" ; "Must configure the tunnel remote-ip" +commit: $(./encapsulation/) != "" ; "Must configure the tunnel encapsulation" +create: "sudo ip tunnel add $(@) local $(./local-ip/@) remote $(./remote-ip/@) mode $(./encapsulation/@)" +create: "sudo ip link set $(@) up" +delete: "sudo ip tunnel del $(@)" +#comp_help: "Enter tunnel interface name (tun0 - tun9)" diff --git a/templates/interfaces/tunnel/node.tag/address/node.def b/templates/interfaces/tunnel/node.tag/address/node.def new file mode 100644 index 00000000..6cef105c --- /dev/null +++ b/templates/interfaces/tunnel/node.tag/address/node.def @@ -0,0 +1,6 @@ +multi: +type: txt +help: "Set IPv4 address and prefix for this interface" +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 $(../@)" diff --git a/templates/interfaces/tunnel/node.tag/description/node.def b/templates/interfaces/tunnel/node.tag/description/node.def new file mode 100644 index 00000000..e443734d --- /dev/null +++ b/templates/interfaces/tunnel/node.tag/description/node.def @@ -0,0 +1,2 @@ +type: txt +help: "Description of this tunnel interface" diff --git a/templates/interfaces/tunnel/node.tag/disable/node.def b/templates/interfaces/tunnel/node.tag/disable/node.def new file mode 100644 index 00000000..56199085 --- /dev/null +++ b/templates/interfaces/tunnel/node.tag/disable/node.def @@ -0,0 +1,3 @@ +help: "Disable interface" +update: "sudo ip link set $(../@) down"; "Error disabling dev $(../@)" +delete: "sudo ip link set $(../@) up"; "Error enabling dev $(../@)" diff --git a/templates/interfaces/tunnel/node.tag/encapsulation/node.def b/templates/interfaces/tunnel/node.tag/encapsulation/node.def new file mode 100644 index 00000000..b578c543 --- /dev/null +++ b/templates/interfaces/tunnel/node.tag/encapsulation/node.def @@ -0,0 +1,5 @@ +type: txt +help: "Set the encapsulation of this tunnel interface" +syntax: $(@) in "ipip", "gre", "sit"; "Must be (ipip, gre, sit)" +#comp_help: "Select an encapsulation (gre, ipip, sit)" +update: "sudo ip tunnel change $(../@) mode $(@)" diff --git a/templates/interfaces/tunnel/node.tag/key/node.def b/templates/interfaces/tunnel/node.tag/key/node.def new file mode 100644 index 00000000..3261229d --- /dev/null +++ b/templates/interfaces/tunnel/node.tag/key/node.def @@ -0,0 +1,4 @@ +type: u32 +help: "Set the tunnel key" +syntax: $(@) >= 0 && $(@) <= 999999; "Must be between 0-999999" +update: "sudo ip tunnel change $(../@) key $(@)" diff --git a/templates/interfaces/tunnel/node.tag/local-ip/node.def b/templates/interfaces/tunnel/node.tag/local-ip/node.def new file mode 100644 index 00000000..6b306a3c --- /dev/null +++ b/templates/interfaces/tunnel/node.tag/local-ip/node.def @@ -0,0 +1,3 @@ +type: ipv4 +help: "Enter the local IP address for this tunnel" + diff --git a/templates/interfaces/tunnel/node.tag/mtu/node.def b/templates/interfaces/tunnel/node.tag/mtu/node.def new file mode 100644 index 00000000..80ea5b06 --- /dev/null +++ b/templates/interfaces/tunnel/node.tag/mtu/node.def @@ -0,0 +1,6 @@ +type: u32 +help: "Set the tunnel MTU" +syntax: $(@) >= 64 && $(@) <= 8024; "Must be between 64-8024" +update: "sudo ip link set $(../@) mtu $(@)" +delete: "sudo ip link set $(../@) mtu 1476" + diff --git a/templates/interfaces/tunnel/node.tag/remote-ip/node.def b/templates/interfaces/tunnel/node.tag/remote-ip/node.def new file mode 100644 index 00000000..b8713e46 --- /dev/null +++ b/templates/interfaces/tunnel/node.tag/remote-ip/node.def @@ -0,0 +1,2 @@ +type: ipv4 +help: "Enter the remote IP address for this tunnel" diff --git a/templates/interfaces/tunnel/node.tag/tos/node.def b/templates/interfaces/tunnel/node.tag/tos/node.def new file mode 100644 index 00000000..7e3d28ae --- /dev/null +++ b/templates/interfaces/tunnel/node.tag/tos/node.def @@ -0,0 +1,5 @@ +type: u32 +help: "Set the tunnel type of service" +syntax: $(@) >= 0 && $(@) <= 99; "Must be between 0-99" +update: "sudo ip tunnel change $(../@) tos $(@)" +delete: "sudo ip tunnel change $(../@) tos inherit" diff --git a/templates/interfaces/tunnel/node.tag/ttl/node.def b/templates/interfaces/tunnel/node.tag/ttl/node.def new file mode 100644 index 00000000..2cb09c73 --- /dev/null +++ b/templates/interfaces/tunnel/node.tag/ttl/node.def @@ -0,0 +1,5 @@ +type: u32 +help: "Set the tunnel time to live" +syntax: $(@) >= 0 && $(@) <= 255; "Must be between 0-255" +update: "sudo ip tunnel change $(../@) ttl $(@)" +delete: "sudo ip tunnel change $(../@) ttl inherit" diff --git a/templates/system/domain-name/node.def b/templates/system/domain-name/node.def index 111061cd..4e3902dc 100644 --- a/templates/system/domain-name/node.def +++ b/templates/system/domain-name/node.def @@ -1,11 +1,9 @@ type: txt help: "Configure system domain name" syntax: pattern $(@) "^[-a-zA-Z0-9.]{0,63}$" ; "invalid domain name $(@)" + # also add localhost line into /etc/hosts (see host-name template)? -update: "sudo sh -c \"if [ x$(@) == x ]; then exit 0; fi && \ -touch /etc/resolv.conf && \ -sed -i '/domain/d' /etc/resolv.conf && \ -echo \\\"domain\t $(@)\\\" >> /etc/resolv.conf\" " +update: "sudo /opt/vyatta/sbin/vyatta_update_resolv.pl" + # also update localhost line in /etc/hosts (see host-name template)? -delete: "sudo sh -c \"touch /etc/resolv.conf && \ -sed -i '/domain\\\\t $(@)/d' /etc/resolv.conf\" " +delete: "sudo /opt/vyatta/sbin/vyatta_update_resolv.pl" |