hi all,

i have an problem with ifstated, here is my setup:

two boxes acting as gateway for a lokal network, sharing the
gw ipaddress via carp, ifstated should be used to switch routes to
another box in case the carp interfaces are changing state ,  which doesnt
seem to work correctly in case the both boxes gets rebootet at the same
time,
the fist box which is master(all carp interfaces are in master state),
is switching
to back state, after ifstated is restartet manualy after boot the state
is setted correctly.


here is my config:

#cat /etc/ifstated.conf
init-state primary

carp_up = "carp1.link.up && carp2.link.up && carp3.link.up &&
carp4.link.up && carp5.link.up && carp6.link.up && carp7.link.up &&
carp8.link.up && carp9.link.up && carp10.link.up && carp20.link.up"

carp_down = "!carp1.link.up && !carp2.link.up && !carp3.link.up &&
!carp4.link.up && !carp5.link.up && !carp6.link.up && !carp7.link.up &&
!carp8.link.up && !carp9.link.up && !carp10.link.up && !carp20.link.up"

state auto {
        if $carp_up
                set-state primary
        if $carp_down
                set-state backup
}

state primary {
        init {
                run "route delete -inet 192.168.0.0/24"
                run "route add -inet 192.168.0.1/24 -interface 91.90.144.1"
       <more route comands>
                    }
        if $carp_down
                set-state backup
}
state backup {
        init {
                run "route delete -inet 192.168.0.0/24"
                run "route add -inet 192.168.0.0/24 192.168.100.2"
           <more route comands>         
        }
        if $carp_up
                set-state primary
}

thx in advance
erich

Reply via email to