summaryrefslogtreecommitdiff
path: root/templates/protocols/static/route/node.tag/dhcp-interface/node.def
blob: e1793c0815d56fb2b8ef03da8f685cc7e0027618 (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  --exec \"${vyos_validators_dir}/interface-name \" --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