# emerge keepalived
I suggest you start with one of the config examples from the doc directory for keepalived.
Also, see
# gzcat /usr/share/doc/keepalived-1.0.3/keepalived.conf.sample.gz > \ /etc/keepalived/keepalived.conf
# rc-update add keepalived start # /etc/init.d/keepalived start