# Why can't I create the carp interface?



## motive6 (Feb 28, 2018)

```
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

```
ifconfig carp0 create
ifconfig: SIOCIFCREATE2: Invalid argument
```

Who can help me


----------



## khuman (Feb 28, 2018)

Because you have to read:
https://www.freebsd.org/doc/en_US.ISO8859-1/books/handbook/carp.html


----------



## motive6 (Feb 28, 2018)

```
root@Lab:~ # cat /boot/loader.conf
carp_load="YES"
```

but is error

```
root@Lab:~ # ifconfig carp0 create
ifconfig: SIOCIFCREATE2: Invalid argument
```
and 

```
root@Lab:~ #  kldload carp
kldload: can't load carp: module already loaded or in kernel
```


----------



## khuman (Feb 28, 2018)

This is old way:

```
# ifconfig carp0 create
```

This way for carp v2 in FreeBSD 10.x and later

```
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 (Feb 28, 2018)

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.


----------



## khuman (Feb 28, 2018)

I haven't preferred custom kernels since some time.


----------

