ifstated

# cd /usr/ports/net/ifstated
# make install clean
# vim /etc/rc.conf
加入以下資料

## ifstated
ifstated_enable=”YES”
ifstated_flags=”-f /usr/local/etc/ifstated.conf”

# vim /usr/local/etc/ifstated.conf
# We want to startup
init-state starting

# net.inet.carp.preempt must be enabled (set to 1)
# for this to work correctly.

carp_up = “carp0.link.up”

state starting {
init {
# Here we boot the box.
if $carp_up
set-state master
if ! $carp_up
set-state not_master
}
}

state not_master {
init {
run “rm /tmp/am_master”
}
if $carp_up
set-state master
}

state master {
init {
run “touch /tmp/am_master”
}
if ! $carp_up
set-state not_master
}

# /usr/local/etc/rc.d/ifstated start

host/provider 都一樣的設定檔
這樣就搞定了…

發佈留言

這個網站採用 Akismet 服務減少垃圾留言。進一步了解 Akismet 如何處理網站訪客的留言資料