diff options
author | Stig Thormodsrud <stig@vyatta.com> | 2007-12-22 19:20:54 -0800 |
---|---|---|
committer | Stig Thormodsrud <stig@vyatta.com> | 2007-12-22 19:20:54 -0800 |
commit | fa71dcd232351c123ac34dcd6622449f9193b0c5 (patch) | |
tree | 73940dbb1eddb3db872a58da85312ed516a79c56 | |
parent | cf3cabae0a7b8b4900687f2bcad927180abace4d (diff) | |
download | vyatta-cfg-system-fa71dcd232351c123ac34dcd6622449f9193b0c5.tar.gz vyatta-cfg-system-fa71dcd232351c123ac34dcd6622449f9193b0c5.zip |
Add tunnel interface.
11 files changed, 52 insertions, 0 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" |