Error on carp/pf FAQ page

falz <[email protected]>
Newsgroups gmane.os.openbsd.www
Message-ID <[email protected]>
I was testing with some carp interfaces based on the FAQ here:

http://www.openbsd.org/faq/pf/carp.html

After running across some strange issues, I noticed that the syntax
for 'ifconfig carpX' is incorrect. It's missing the 'netmask' keyword.
Without this, it defaults to a class A, which generally screws
everything up (at least in my scenario)

The syntax is correct when it's assigning an IP to the physical
interface (em1 in the example):

# ifconfig em1 10.10.10.1 netmask 255.255.255.0


But wrong with the carp interface:

# ifconfig carp1 vhid 1 pass mekmitasdigoat carpdev em0 \
    advskew 100 10.0.0.1 255.255.255.0


it should be:

# ifconfig carp1 vhid 1 pass mekmitasdigoat carpdev em0 \
    advskew 100 10.0.0.1 netmask 255.255.255.0


Giving the command without 'netmask' keyword assigns a mask of
0xff000000. In my example of trying this in a live environment with
about 80 carp interfaces with vlan parent interfaces, the newly
brought up interface with a /8 basicly causes destruction.

It appears to be correct in the man page. OpenBSD newbies like myself
that were following the FAQ instead of the manpage will likely be
bitten by this.

Thanks!
--falz
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.