diff options
author | Kim Hagen <khagen@multi-development.com> | 2014-06-26 11:07:06 +0200 |
---|---|---|
committer | Kim Hagen <khagen@multi-development.com> | 2014-06-26 11:07:06 +0200 |
commit | c52db2fa5e8cd1f8b3cadb48b657e707e28a7a1f (patch) | |
tree | 1c9575d1cf175debb519efe20e3d1e6e070d5ec0 /templates | |
parent | 4a7af45ec1c4267d6a71f4dc5e8df3bf37687de0 (diff) | |
download | vyatta-cfg-system-c52db2fa5e8cd1f8b3cadb48b657e707e28a7a1f.tar.gz vyatta-cfg-system-c52db2fa5e8cd1f8b3cadb48b657e707e28a7a1f.zip |
Add QinQ vlan to Bonding and pseudo-ethernet interfaces.
Diffstat (limited to 'templates')
25 files changed, 261 insertions, 4 deletions
diff --git a/templates/interfaces/bonding/node.tag/vif/node.def b/templates/interfaces/bonding/node.tag/vif/node.def index 63394e44..eb3b1940 100644 --- a/templates/interfaces/bonding/node.tag/vif/node.def +++ b/templates/interfaces/bonding/node.tag/vif/node.def @@ -10,9 +10,9 @@ create: read -a SLAVES </sys/class/net/$VAR(../@)/bonding/slaves echo "Must configure slave devices for bond interface $VAR(../@) before adding vif" exit 1 fi - ip link add link $VAR(../@) name "$VAR(../@).$VAR(@)" type vlan id $VAR(@) || exit 1 + ip link add link $VAR(../@) name "$VAR(../@).$VAR(@)" type vlan proto 802.1ad id $VAR(@) || exit 1 ip link set "$VAR(../@).$VAR(@)" up /opt/vyatta/sbin/vyatta-link-detect "$VAR(../@).$VAR(@)" on delete: [ -d /sys/class/net/$VAR(../@).$VAR(@) ] || exit 0 - ip link delete dev "$VAR(../@).$VAR(@)" type vlan id $VAR(@) + ip link delete dev ".$VAR(../@).$VAR(@)" type vlan proto 802.1ad id $VAR(@) diff --git a/templates/interfaces/bonding/node.tag/vif/node.tag/vif/node.def b/templates/interfaces/bonding/node.tag/vif/node.tag/vif/node.def new file mode 100644 index 00000000..a98329ab --- /dev/null +++ b/templates/interfaces/bonding/node.tag/vif/node.tag/vif/node.def @@ -0,0 +1,18 @@ +tag: +priority: 321 +type: u32 +help: Nested Virtual Local Area Network (VLAN) ID +syntax:expression: $VAR(@) >= 0 && $VAR(@) <= 4094; "VLAN ID must be between 0 and 4094" +val_help: u32:0-4094; VLAN ID + +create: read -a SLAVES </sys/class/net/$VAR(../../@)/bonding/slaves + if [ ${#SLAVES[*]} -eq 0 ]; then + echo "Must configure slave devices for bond interface $VAR(../../@) before adding vif" + exit 1 + fi + ip link add link $VAR(../../@).$VAR(../@) name "$VAR(../../@).$VAR(../@).$VAR(@)" type vlan proto 802.1q id $VAR(@) || exit 1 + ip link set "$VAR(../../@).$VAR(../@).$VAR(@)" up + /opt/vyatta/sbin/vyatta-link-detect "$VAR(../../@).$VAR(../@).$VAR(@)" on + +delete: [ -d /sys/class/net/$VAR(../../@).$VAR(../@).$VAR(@) ] || exit 0 + ip link delete dev "$VAR(../../@).$VAR(../@).$VAR(@)" type vlan proto 802.1q id $VAR(@) diff --git a/templates/interfaces/bonding/node.tag/vif/node.tag/vif/node.tag/address/node.def b/templates/interfaces/bonding/node.tag/vif/node.tag/vif/node.tag/address/node.def new file mode 100644 index 00000000..415ef4b3 --- /dev/null +++ b/templates/interfaces/bonding/node.tag/vif/node.tag/vif/node.tag/address/node.def @@ -0,0 +1,17 @@ +multi: +type: txt +help: IP address + +syntax:expression: exec "/opt/vyatta/sbin/valid_address $VAR(@)" + +commit:expression: exec "/opt/vyatta/sbin/vyatta-interfaces.pl --valid-addr-commit $VAR(@@) --dev $VAR(../../../@).$VAR(../../@).$VAR(../@)" + +create: sudo /opt/vyatta/sbin/vyatta-address add $VAR(../../../@).$VAR(../../@).$VAR(../@) $VAR(@) + +delete: sudo /opt/vyatta/sbin/vyatta-address delete $VAR(../../../@).$VAR(../../@).$VAR(../@) $VAR(@) + +allowed: echo "dhcp <>" +val_help: ipv4net; IP address and prefix length +val_help: ipv6net; IPv6 address and prefix length +val_help: dhcp; Dynamic Host Configuration Protocol +val_help: dhcpv6; Dynamic Host Configuration Protocol for IPv6 diff --git a/templates/interfaces/bonding/node.tag/vif/node.tag/vif/node.tag/bridge-group/bridge/node.def b/templates/interfaces/bonding/node.tag/vif/node.tag/vif/node.tag/bridge-group/bridge/node.def new file mode 100644 index 00000000..0766f8af --- /dev/null +++ b/templates/interfaces/bonding/node.tag/vif/node.tag/vif/node.tag/bridge-group/bridge/node.def @@ -0,0 +1,8 @@ +type: txt + +help: Bridge group interface + +commit:expression: exec \ + "/opt/vyatta/sbin/vyatta-interfaces.pl --dev=$VAR(@) --check=bridge" + +allowed: /opt/vyatta/sbin/vyatta-interfaces.pl --show=bridge diff --git a/templates/interfaces/bonding/node.tag/vif/node.tag/vif/node.tag/bridge-group/cost/node.def b/templates/interfaces/bonding/node.tag/vif/node.tag/vif/node.tag/bridge-group/cost/node.def new file mode 100644 index 00000000..243747b9 --- /dev/null +++ b/templates/interfaces/bonding/node.tag/vif/node.tag/vif/node.tag/bridge-group/cost/node.def @@ -0,0 +1,4 @@ +type: u32 +help: Path cost for this port +syntax:expression: $VAR(@) >= 1 && $VAR(@) < 65536 ; "Bridge cost value must be between 1 and 65535" +val_help: u32:1-65535; Path cost value for Spanning Tree Protocol diff --git a/templates/interfaces/bonding/node.tag/vif/node.tag/vif/node.tag/bridge-group/node.def b/templates/interfaces/bonding/node.tag/vif/node.tag/vif/node.tag/bridge-group/node.def new file mode 100644 index 00000000..f1e45c42 --- /dev/null +++ b/templates/interfaces/bonding/node.tag/vif/node.tag/vif/node.tag/bridge-group/node.def @@ -0,0 +1,4 @@ +priority: 325 # after vif and bridge +help: Add this interface to a bridge group + +end: /opt/vyatta/sbin/vyatta-bridge.pl ${COMMIT_ACTION} $VAR(../../../@).$VAR(../../@).$VAR(../@) diff --git a/templates/interfaces/bonding/node.tag/vif/node.tag/vif/node.tag/bridge-group/priority/node.def b/templates/interfaces/bonding/node.tag/vif/node.tag/vif/node.tag/bridge-group/priority/node.def new file mode 100644 index 00000000..be0ff479 --- /dev/null +++ b/templates/interfaces/bonding/node.tag/vif/node.tag/vif/node.tag/bridge-group/priority/node.def @@ -0,0 +1,4 @@ +type: u32 +help: Bridge port priority +syntax:expression: $VAR(@) >= 0 &&$VAR(@) < 64; "Port priority must be between 0-63" +val_help: u32:0-63; Bridge port priority diff --git a/templates/interfaces/bonding/node.tag/vif/node.tag/vif/node.tag/description/node.def b/templates/interfaces/bonding/node.tag/vif/node.tag/vif/node.tag/description/node.def new file mode 100644 index 00000000..9324ce1b --- /dev/null +++ b/templates/interfaces/bonding/node.tag/vif/node.tag/vif/node.tag/description/node.def @@ -0,0 +1,8 @@ +type: txt +help: Description + +syntax:expression: pattern $VAR(@) "^.{1,256}$" \ + ; "interface description is too long (limit 256 characters)" + +update: sudo sh -c "echo \"$VAR(@)\" >/sys/class/net/$VAR(../../../@).$VAR(../../@).$VAR(../@)/ifalias" +delete: sudo sh -c "echo '' >/sys/class/net/$VAR(../../../@).$VAR(../../@).$VAR(../@)/ifalias" diff --git a/templates/interfaces/bonding/node.tag/vif/node.tag/vif/node.tag/dhcpv6-options/node.def b/templates/interfaces/bonding/node.tag/vif/node.tag/vif/node.tag/dhcpv6-options/node.def new file mode 100644 index 00000000..805315fc --- /dev/null +++ b/templates/interfaces/bonding/node.tag/vif/node.tag/vif/node.tag/dhcpv6-options/node.def @@ -0,0 +1,47 @@ +# This node is run before the rest of the interface is configured. +# We first check to see if DHCPv6 is still configured on the interface by +# looking over at the interface address parameters. Then we check to see +# if the DHCPv6 client program is still running on this interface. If both +# of those are true, then any change to this tree means that the user +# has changed this tree ONLY, and that we are going to have to re-start +# the DHCPv6 client using the new parameters. + + +priority: 317 # Run before interface has been configured + +help: DHCPv6 options + +end: + ifname="$VAR(../../../@).$VAR(../../@).$VAR(../@)" + + dhcpv6_set=0 + for param in $VAR(../address/@@); do + if [ "$param" = "dhcpv6" ]; then + dhcpv6_set=1 + fi + done + + if [ $dhcpv6_set -eq 0 ]; then + echo "DHCPv6 is not configured on this interface" + exit 0 + fi + + conffile=/var/lib/dhcp3/dhclient_v6_$VAR(../@).conf + if [ ! -e $conffile ]; then + echo "Conf file $conffile doesn't exist" + exit 0 + fi + + if [ -n "$VAR(./parameters-only)" ]; then + arg1="--parameters-only" + fi + + if [ -n "$VAR(./temporary)" ]; then + arg2="--temporary" + fi + + echo "Re-starting DHCPv6 client on ${ifname}..." + sudo /opt/vyatta/sbin/vyatta-dhcpv6-client.pl --stop --start \ + --ifname $ifname $arg1 $arg2 + + exit 0 diff --git a/templates/interfaces/bonding/node.tag/vif/node.tag/vif/node.tag/dhcpv6-options/parameters-only/node.def b/templates/interfaces/bonding/node.tag/vif/node.tag/vif/node.tag/dhcpv6-options/parameters-only/node.def new file mode 100644 index 00000000..0e407f81 --- /dev/null +++ b/templates/interfaces/bonding/node.tag/vif/node.tag/vif/node.tag/dhcpv6-options/parameters-only/node.def @@ -0,0 +1,3 @@ + +help: Acquire only config parameters, not address + diff --git a/templates/interfaces/bonding/node.tag/vif/node.tag/vif/node.tag/dhcpv6-options/temporary/node.def b/templates/interfaces/bonding/node.tag/vif/node.tag/vif/node.tag/dhcpv6-options/temporary/node.def new file mode 100644 index 00000000..a850ef4b --- /dev/null +++ b/templates/interfaces/bonding/node.tag/vif/node.tag/vif/node.tag/dhcpv6-options/temporary/node.def @@ -0,0 +1,3 @@ + +help: IPv6 "temporary" address + diff --git a/templates/interfaces/bonding/node.tag/vif/node.tag/vif/node.tag/disable-link-detect/node.def b/templates/interfaces/bonding/node.tag/vif/node.tag/vif/node.tag/disable-link-detect/node.def new file mode 100644 index 00000000..ed593317 --- /dev/null +++ b/templates/interfaces/bonding/node.tag/vif/node.tag/vif/node.tag/disable-link-detect/node.def @@ -0,0 +1,3 @@ +help: Ignore link state changes +update:/opt/vyatta/sbin/vyatta-link-detect $VAR(../../../@).$VAR(../../@).$VAR(../@) on +delete:/opt/vyatta/sbin/vyatta-link-detect $VAR(../../../@).$VAR(../../@).$VAR(../@) off diff --git a/templates/interfaces/bonding/node.tag/vif/node.tag/vif/node.tag/disable/node.def b/templates/interfaces/bonding/node.tag/vif/node.tag/vif/node.tag/disable/node.def new file mode 100644 index 00000000..31c5a9b2 --- /dev/null +++ b/templates/interfaces/bonding/node.tag/vif/node.tag/vif/node.tag/disable/node.def @@ -0,0 +1,11 @@ +help: Disable interface +update: /etc/netplug/linkdown.d/dhclient $VAR(../../../@).$VAR(../../@).$VAR(../@) + if ! ip link set $VAR(../../../@).$VAR(../../@).$VAR(../@) down 2>/dev/null; then + echo "Error disabling dev $VAR(../../../@).$VAR(../../@).$VAR(../@)" + /etc/netplug/linkup.d/dhclient $VAR(../../../@).$VAR(../../@).$VAR(../@) + exit 1 + fi +delete: if ! ip link set $VAR(../../../@).$VAR(../../@).$VAR(../@) up; then + echo "Error enabling dev $VAR(../../../@).$VAR(../../@).$VAR(../@)" + exit 1 + fi diff --git a/templates/interfaces/bonding/node.tag/vif/node.tag/vif/node.tag/mtu/node.def b/templates/interfaces/bonding/node.tag/vif/node.tag/vif/node.tag/mtu/node.def new file mode 100644 index 00000000..eea81e2a --- /dev/null +++ b/templates/interfaces/bonding/node.tag/vif/node.tag/vif/node.tag/mtu/node.def @@ -0,0 +1,9 @@ +type: u32 +priority: 381 +help: Maximum Transmission Unit (MTU) +val_help: u32:68-9000; Maximum Transmission Unit (MTU) +syntax:expression: $VAR(@) >= 68 && $VAR(@) <= 9000; "MTU must be between 68 and 9000" + +update: ip link set $VAR(../../../@).$VAR(../../@).$VAR(../@) mtu $VAR(@) +delete: [ -d /sys/class/net/$VAR(../../../@).$VAR(../../@).$VAR(../@) ] || exit 0 + ip link set $VAR(../../../@).$VAR(../../@).$VAR(../@) mtu 1500 diff --git a/templates/interfaces/pseudo-ethernet/node.tag/vif/node.def b/templates/interfaces/pseudo-ethernet/node.tag/vif/node.def index 2c73ca16..1cec9922 100644 --- a/templates/interfaces/pseudo-ethernet/node.tag/vif/node.def +++ b/templates/interfaces/pseudo-ethernet/node.tag/vif/node.def @@ -5,9 +5,9 @@ help: Virtual Local Area Network (VLAN) ID syntax:expression: $VAR(@) >= 0 && $VAR(@) <= 4094; "VLAN ID must be between 0 and 4094" val_help: u32:0-4094; VLAN ID -create: ip link add link $VAR(../@) name "$VAR(../@).$VAR(@)" type vlan id $VAR(@) || exit 1 +create: ip link add link $VAR(../@) name "$VAR(../@).$VAR(@)" type vlan proto 802.1ad id $VAR(@) || exit 1 ip link set "$VAR(../@).$VAR(@)" up /opt/vyatta/sbin/vyatta-link-detect "$VAR(../@).$VAR(@)" on delete: [ -d /sys/class/net/$VAR(../@).$VAR(@) ] || exit 0 - ip link delete dev "$VAR(../@).$VAR(@)" type vlan id $VAR(@) + ip link delete dev "$VAR(../@).$VAR(@)" type vlan proto 802.1ad id $VAR(@) diff --git a/templates/interfaces/pseudo-ethernet/node.tag/vif/node.tag/vif/node.def b/templates/interfaces/pseudo-ethernet/node.tag/vif/node.tag/vif/node.def new file mode 100644 index 00000000..4f3e0c21 --- /dev/null +++ b/templates/interfaces/pseudo-ethernet/node.tag/vif/node.tag/vif/node.def @@ -0,0 +1,13 @@ +tag: +priority: 321 +type: u32 +help: Virtual Local Area Network (VLAN) ID +syntax:expression: $VAR(@) >= 0 && $VAR(@) <= 4094; "VLAN ID must be between 0 and 4094" +val_help: u32:0-4094; VLAN ID + +create: ip link add link $VAR(../../@).$VAR(../@) name "$VAR(../../@).$VAR(../@).$VAR(@)" type vlan proto 802.1q id $VAR(@) || exit 1 + ip link set "$VAR(../../@).$VAR(../@).$VAR(@)" up + /opt/vyatta/sbin/vyatta-link-detect "$VAR(../../@).$VAR(../@).$VAR(@)" on + +delete: [ -d /sys/class/net/$VAR(../../@).$VAR(../@).$VAR(@) ] || exit 0 + ip link delete dev "$VAR(../../@).$VAR(../@).$VAR(@)" type vlan proto 802.1q id $VAR(@) diff --git a/templates/interfaces/pseudo-ethernet/node.tag/vif/node.tag/vif/node.tag/address/node.def b/templates/interfaces/pseudo-ethernet/node.tag/vif/node.tag/vif/node.tag/address/node.def new file mode 100644 index 00000000..93476d60 --- /dev/null +++ b/templates/interfaces/pseudo-ethernet/node.tag/vif/node.tag/vif/node.tag/address/node.def @@ -0,0 +1,18 @@ +multi: +type: txt +help: IP address + +syntax:expression: exec "/opt/vyatta/sbin/valid_address $VAR(@)" + +commit:expression: exec "/opt/vyatta/sbin/vyatta-interfaces.pl --valid-addr-commit $VAR(@@) --dev $VAR(../../../@).$VAR(../../@).$VAR(../@)" + +create: sudo /opt/vyatta/sbin/vyatta-address add $VAR(../../../@).$VAR(../../@).$VAR(../@) $VAR(@) + +delete: sudo /opt/vyatta/sbin/vyatta-address delete $VAR(../../../@).$VAR(../../@).$VAR(../@) $VAR(@) + +allowed: echo "dhcp <>" + +val_help: ipv4net; IP address and prefix length +val_help: ipv6net; IPv6 address and prefix length +val_help: dhcp; Dynamic Host Configuration Protocol +val_help: dhcpv6; Dynamic Host Configuration Protocol for IPv6 diff --git a/templates/interfaces/pseudo-ethernet/node.tag/vif/node.tag/vif/node.tag/description/node.def b/templates/interfaces/pseudo-ethernet/node.tag/vif/node.tag/vif/node.tag/description/node.def new file mode 100644 index 00000000..9324ce1b --- /dev/null +++ b/templates/interfaces/pseudo-ethernet/node.tag/vif/node.tag/vif/node.tag/description/node.def @@ -0,0 +1,8 @@ +type: txt +help: Description + +syntax:expression: pattern $VAR(@) "^.{1,256}$" \ + ; "interface description is too long (limit 256 characters)" + +update: sudo sh -c "echo \"$VAR(@)\" >/sys/class/net/$VAR(../../../@).$VAR(../../@).$VAR(../@)/ifalias" +delete: sudo sh -c "echo '' >/sys/class/net/$VAR(../../../@).$VAR(../../@).$VAR(../@)/ifalias" diff --git a/templates/interfaces/pseudo-ethernet/node.tag/vif/node.tag/vif/node.tag/dhcpv6-options/node.def b/templates/interfaces/pseudo-ethernet/node.tag/vif/node.tag/vif/node.tag/dhcpv6-options/node.def new file mode 100644 index 00000000..805315fc --- /dev/null +++ b/templates/interfaces/pseudo-ethernet/node.tag/vif/node.tag/vif/node.tag/dhcpv6-options/node.def @@ -0,0 +1,47 @@ +# This node is run before the rest of the interface is configured. +# We first check to see if DHCPv6 is still configured on the interface by +# looking over at the interface address parameters. Then we check to see +# if the DHCPv6 client program is still running on this interface. If both +# of those are true, then any change to this tree means that the user +# has changed this tree ONLY, and that we are going to have to re-start +# the DHCPv6 client using the new parameters. + + +priority: 317 # Run before interface has been configured + +help: DHCPv6 options + +end: + ifname="$VAR(../../../@).$VAR(../../@).$VAR(../@)" + + dhcpv6_set=0 + for param in $VAR(../address/@@); do + if [ "$param" = "dhcpv6" ]; then + dhcpv6_set=1 + fi + done + + if [ $dhcpv6_set -eq 0 ]; then + echo "DHCPv6 is not configured on this interface" + exit 0 + fi + + conffile=/var/lib/dhcp3/dhclient_v6_$VAR(../@).conf + if [ ! -e $conffile ]; then + echo "Conf file $conffile doesn't exist" + exit 0 + fi + + if [ -n "$VAR(./parameters-only)" ]; then + arg1="--parameters-only" + fi + + if [ -n "$VAR(./temporary)" ]; then + arg2="--temporary" + fi + + echo "Re-starting DHCPv6 client on ${ifname}..." + sudo /opt/vyatta/sbin/vyatta-dhcpv6-client.pl --stop --start \ + --ifname $ifname $arg1 $arg2 + + exit 0 diff --git a/templates/interfaces/pseudo-ethernet/node.tag/vif/node.tag/vif/node.tag/dhcpv6-options/parameters-only/node.def b/templates/interfaces/pseudo-ethernet/node.tag/vif/node.tag/vif/node.tag/dhcpv6-options/parameters-only/node.def new file mode 100644 index 00000000..0e407f81 --- /dev/null +++ b/templates/interfaces/pseudo-ethernet/node.tag/vif/node.tag/vif/node.tag/dhcpv6-options/parameters-only/node.def @@ -0,0 +1,3 @@ + +help: Acquire only config parameters, not address + diff --git a/templates/interfaces/pseudo-ethernet/node.tag/vif/node.tag/vif/node.tag/dhcpv6-options/temporary/node.def b/templates/interfaces/pseudo-ethernet/node.tag/vif/node.tag/vif/node.tag/dhcpv6-options/temporary/node.def new file mode 100644 index 00000000..a850ef4b --- /dev/null +++ b/templates/interfaces/pseudo-ethernet/node.tag/vif/node.tag/vif/node.tag/dhcpv6-options/temporary/node.def @@ -0,0 +1,3 @@ + +help: IPv6 "temporary" address + diff --git a/templates/interfaces/pseudo-ethernet/node.tag/vif/node.tag/vif/node.tag/disable-link-detect/node.def b/templates/interfaces/pseudo-ethernet/node.tag/vif/node.tag/vif/node.tag/disable-link-detect/node.def new file mode 100644 index 00000000..ed593317 --- /dev/null +++ b/templates/interfaces/pseudo-ethernet/node.tag/vif/node.tag/vif/node.tag/disable-link-detect/node.def @@ -0,0 +1,3 @@ +help: Ignore link state changes +update:/opt/vyatta/sbin/vyatta-link-detect $VAR(../../../@).$VAR(../../@).$VAR(../@) on +delete:/opt/vyatta/sbin/vyatta-link-detect $VAR(../../../@).$VAR(../../@).$VAR(../@) off diff --git a/templates/interfaces/pseudo-ethernet/node.tag/vif/node.tag/vif/node.tag/disable/node.def b/templates/interfaces/pseudo-ethernet/node.tag/vif/node.tag/vif/node.tag/disable/node.def new file mode 100644 index 00000000..31c5a9b2 --- /dev/null +++ b/templates/interfaces/pseudo-ethernet/node.tag/vif/node.tag/vif/node.tag/disable/node.def @@ -0,0 +1,11 @@ +help: Disable interface +update: /etc/netplug/linkdown.d/dhclient $VAR(../../../@).$VAR(../../@).$VAR(../@) + if ! ip link set $VAR(../../../@).$VAR(../../@).$VAR(../@) down 2>/dev/null; then + echo "Error disabling dev $VAR(../../../@).$VAR(../../@).$VAR(../@)" + /etc/netplug/linkup.d/dhclient $VAR(../../../@).$VAR(../../@).$VAR(../@) + exit 1 + fi +delete: if ! ip link set $VAR(../../../@).$VAR(../../@).$VAR(../@) up; then + echo "Error enabling dev $VAR(../../../@).$VAR(../../@).$VAR(../@)" + exit 1 + fi diff --git a/templates/interfaces/pseudo-ethernet/node.tag/vif/node.tag/vif/node.tag/ip/enable-proxy-arp/node.def b/templates/interfaces/pseudo-ethernet/node.tag/vif/node.tag/vif/node.tag/ip/enable-proxy-arp/node.def new file mode 100644 index 00000000..dd572811 --- /dev/null +++ b/templates/interfaces/pseudo-ethernet/node.tag/vif/node.tag/vif/node.tag/ip/enable-proxy-arp/node.def @@ -0,0 +1,3 @@ +help: Enable proxy-arp on this interface +create:expression: "sudo sh -c \"echo 1 > /proc/sys/net/ipv4/conf/$VAR(../../../../@).$VAR(../../../@).$VAR(../../@)/proxy_arp\" " +delete:expression: "sudo sh -c \"echo 0 > /proc/sys/net/ipv4/conf/$VAR(../../../../@).$VAR(../../../@).$VAR(../../@)/proxy_arp\" " diff --git a/templates/interfaces/pseudo-ethernet/node.tag/vif/node.tag/vif/node.tag/mtu/node.def b/templates/interfaces/pseudo-ethernet/node.tag/vif/node.tag/vif/node.tag/mtu/node.def new file mode 100644 index 00000000..eea81e2a --- /dev/null +++ b/templates/interfaces/pseudo-ethernet/node.tag/vif/node.tag/vif/node.tag/mtu/node.def @@ -0,0 +1,9 @@ +type: u32 +priority: 381 +help: Maximum Transmission Unit (MTU) +val_help: u32:68-9000; Maximum Transmission Unit (MTU) +syntax:expression: $VAR(@) >= 68 && $VAR(@) <= 9000; "MTU must be between 68 and 9000" + +update: ip link set $VAR(../../../@).$VAR(../../@).$VAR(../@) mtu $VAR(@) +delete: [ -d /sys/class/net/$VAR(../../../@).$VAR(../../@).$VAR(../@) ] || exit 0 + ip link set $VAR(../../../@).$VAR(../../@).$VAR(../@) mtu 1500 |