Why can't I create the carp interface?

motive6

New Member


Messages: 2

#1
Code:
root@Lab:~ # uname -a
FreeBSD Lab 10.4-RELEASE FreeBSD 10.4-RELEASE #0: Wed Feb 28 23:39:33 CST 2018     root@Lab:/usr/obj/usr/src/sys/GATEWAY  amd64

1、cd /usr/src/sys/amd64/conf
2、cp GENERIC GATEWAY
3、ee GATEWAY
# CARP support
device          carp

# PF Firewall support
device          pf
device          pfsync
device          pflog

4、cd /usr/src
5、make buildkernel KERNCONF=GATEWAY
6、make installkernel KERNCONF=GATEWAY
but,if i create carp0,is error
Code:
ifconfig carp0 create
ifconfig: SIOCIFCREATE2: Invalid argument
Who can help me
 
OP
OP
M

motive6

New Member


Messages: 2

#3
Code:
root@Lab:~ # cat /boot/loader.conf
carp_load="YES"
but is error
Code:
root@Lab:~ # ifconfig carp0 create
ifconfig: SIOCIFCREATE2: Invalid argument
and
Code:
root@Lab:~ #  kldload carp
kldload: can't load carp: module already loaded or in kernel
 

khuman

New Member

Thanks: 2
Messages: 11

#4
This is old way:
Code:
# ifconfig carp0 create
This way for carp v2 in FreeBSD 10.x and later
Code:
ifconfig_em0="inet 192.168.1.3 netmask 255.255.255.0"
ifconfig_em0_alias0="inet vhid 1 pass testpass alias 192.168.1.50/32"
 

SirDice

Administrator
Staff member
Administrator
Moderator

Thanks: 6,347
Messages: 27,540

#5
You don't need to create a custom kernel to enable carp(4). You can load it as a module.

And as khuman noted, the way carp(4) is configured is different from 10.0 onward. Both ways are explained in the handbook.
 
Top