⬢ DragonFlyBSD Kernel Audit
DF-3298 / setup.sh
← back to finding ↓ download raw
#!/bin/sh
# DF-3298 - setup: tap0 backing + carp0 (vhid 1, key "pocpass", MASTER)
# Run as root in the guest.
set -e
cd /root/df3298

# clean slate (idempotent)
ifconfig carp0 destroy 2>/dev/null || true
ifconfig tap0 destroy 2>/dev/null || true

kldload if_tap 2>/dev/null || true
ifconfig tap create
ifconfig tap0 10.0.0.1/24 up

ifconfig carp create
ifconfig carp0 vhid 1 pass pocpass advbase 1 advskew 100
ifconfig carp0 10.0.0.100/24
ifconfig carp0 up
./setstate carp0 2        # force MASTER (BACKUP -> MASTER)
sleep 0.3
echo '--- ifconfig carp0 ---'
ifconfig carp0
echo '--- ifconfig tap0 ---'
ifconfig tap0 | head -3
echo '--- M_CARP usage (vmstat -m) BEFORE destroy scenario ---'
vmstat -m | grep -i carp || true