Cisco said:Now, the "track" command was originally used with things like HSRP or VRRP, which are standby protocols for multi-gateway scenarios
and I can config static route,and if there is any problem at the ISP back-end,the static route will inavtive
Quote:
Router#configure terminal
Enter configuration commands, one per line. End with CNTL/Z.
Router(config)#track 11 ip route 10.2.95.0 255.255.255.0 reachability
Router(config-track)#delay down 5 up 5
Router(config-track)#exit
Router(config)#ip route 0.0.0.0 0.0.0.0 10.3.12.26 track 11
Router(config)#end
who can tell me how to do it in vyatta?
thanks

I write simple script ,who can make it better??thanks
#!/usr/bin/perl -w use Net::Ping; $pinghost=Net::Ping->new(); if($pinghost->ping("58.211.58.163")){ }else { process(" set "); } $pinghost->close(); sub process { my ($option)=@_; $opwrapper="/opt/vyatta/sbin/vyatta-cfg-cmd-wrapper "; $setstr=$opwrapper.$option." protocols static route 0.0.0.0/0 next-hop 192.168.0.254 disable\n"; print $setstr; system($opwrapper." begin"); system($setstr); system($opwrapper." commit"); system($opwrapper." end"); }You are going to a lot of effort to script Vyatta CLI.
If you just want to change a route, either script the 'ip route' command
or better yet use vtysh to talk to quagga. As long as you don't expect
the change to persist across reboot, this is easier and simpler.
thank 'shemminger'
I ONLY want monitor route.I use cisco config like this
the 10.1.1.242 is ISP give ip address,I use E1,and the line is alway on,unless power down.So,if the 10.1.1.242 can not reachability,the default route is down,and I can use another static route(distance=50,very slowly,but can use)
I think is it any possible use Service Level Agreement (sla) to Vyatta?
can you give me some advise?? thanks.
#!/bin/vbash declare -a interfaces interfaces=$(ip route |grep default| awk '{print $5}') for interface in $interfaces do count=$(ping -c $1 -I $interface $2| grep 'received' | awk -F',' '{ print $2 }' | awk '{ print $1 }') if [ $count -eq 0 ];then gw=$(ip route |grep default|grep $interface| awk '{print $3}') route del default gw $gw fi done echo $countWhat are you trying to do? Please describe the scenario in more detail.
Sounds like some alternate kind of failover mechanism.
thaks shemminger.
I only want to track static route,not only when line down,but also Destination host unreachable and the line up.For instance,you route can arrive the gateway provide by you ISP,but you ISP can not arrive yahoo.com,now I must disable static route,and up another routing (static or dynamic).I have post ahead.
understand me?