Created
November 20, 2017 16:02
-
-
Save lgcosta/d7dce5aac1f83c64d53d548f5e9f695e to your computer and use it in GitHub Desktop.
A way to simulate the arp.balance of the carp in freebsd 11.x
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
if [ "$2" == "MASTER" ]; then | |
if [ "$(echo $1 | grep em0)" ]; then | |
ifconfig em0 ether 08:00:27:2c:95:00 | |
fi | |
if [ "$(echo $1 | grep em1)" ]; then | |
ifconfig em1 ether 08:00:27:ef:b4:00 | |
fi | |
fi | |
if [ "$2" == "BACKUP" ]; then | |
if [ "$(echo $1 | grep em0)" ]; then | |
HW="$(ifconfig em0 | sed -n -e '/hwaddr/p' | grep -o -E '([[:xdigit:]]{1,2}:){5}[[:xdigit:]]{1,2}')" | |
ifconfig em0 ether $HW | |
fi | |
if [ "$(echo $1 | grep em1)" ]; then | |
HW="$(ifconfig em1 | sed -n -e '/hwaddr/p' | grep -o -E '([[:xdigit:]]{1,2}:){5}[[:xdigit:]]{1,2}')" | |
ifconfig em1 ether $HW | |
fi | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hi, could you please elaborate more about this and your setup, I am trying FreeBSD 12 (no
hwaddr
) but having lots of messages like:My guess is that it could be related to how carp is dealing with the arp.