summaryrefslogtreecommitdiff
path: root/templates/protocols/static/route/node.tag/dhcp-interface/node.def
blob: 554f3f50353cfb4113e59c438907eca71c565815 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
type: txt
help: DHCP interface supplying next-hop IP address
val_help: txt; DHCP interface name
allowed: sh -c "${vyos_completion_dir}/list_interfaces.py"
syntax:expression: exec "${vyos_libexec_dir}/validate-value --regex \'(bond|br|dum|en|ersp|eth|gnv|lan|l2tp|l2tpeth|macsec|peth|ppp|pppoe|pptp|sstp|tun|veth|vti|vtun|vxlan|wg|wlan|wwan)[0-9]+(.\\d+)?|lo\' --exec \"${vyos_validators_dir}/file-path --lookup-path /sys/class/net --directory \"  --value \'$VAR(@)\'"; "Invalid value"
create:
        sudo /opt/vyatta/sbin/vyatta-update-static-route.pl --interface=$VAR(@) --route=$VAR(../@) --table=main --option=create
        RIP=$(/opt/vyatta/sbin/vyatta-dhcp-helper.pl --interface=$VAR(@) --want=router)
        if [ "$RIP" != "127.0.0.1" ]; then
	        vtysh -c "configure terminal" \
                  -c "ip route $VAR(../@) $RIP"
        fi
update:
        sudo /opt/vyatta/sbin/vyatta-update-static-route.pl --interface=$VAR(@) --route=$VAR(../@) --table=main --option=create
        RIP=$(/opt/vyatta/sbin/vyatta-dhcp-helper.pl --interface=$VAR(@) --want=router)
        if [ "$RIP" != "127.0.0.1" ]; then
	        vtysh -c "configure terminal" \
                  -c "ip route $VAR(../@) $RIP"
        fi
delete:
        sudo /opt/vyatta/sbin/vyatta-update-static-route.pl --interface=$VAR(@) --route=$VAR(../@) --table=main --option=delete
        RIP=$(/opt/vyatta/sbin/vyatta-dhcp-helper.pl --interface=$VAR(@) --want=router)
        if [ "$RIP" != "127.0.0.1" ]; then
	        vtysh -c "configure terminal" \
                  -c "no ip route $VAR(../@) $RIP"
        fi