# Some problems with CARP



## sibdoma (Nov 17, 2008)

I'm using CARP on FreeBSD 7.1-PRERELEASE.

```
sysctl net.inet.carp
net.inet.carp.allow: 1
net.inet.carp.preempt: 1
net.inet.carp.log: 1
net.inet.carp.arpbalance: 1
net.inet.carp.suppress_preempt: 0
```
And I have some common IP addresses on different vlan's.
I cant use _carpdev_ option on FreeBSD, so, first, i have to appoint ip addresses to my vlan-interfaces.
Finally I have working version of CARP
*HOST 1*

```
ifconfig carp0
carp0: flags=49<UP,LOOPBACK,RUNNING> metric 0 mtu 1500
        inet 172.17.5.1 netmask 0xffffff00
        carp: MASTER vhid 1 advbase 1 advskew 0

ifconfig carp1
carp1: flags=49<UP,LOOPBACK,RUNNING> metric 0 mtu 1500
        inet 172.17.5.1 netmask 0xffffff00
        carp: BACKUP vhid 2 advbase 1 advskew 100
```

*HOST 2*

```
carp0: flags=49<UP,LOOPBACK,RUNNING> metric 0 mtu 1500
        inet 172.17.5.1 netmask 0xffffff00
        carp: BACKUP vhid 1 advbase 1 advskew 100

carp1: flags=49<UP,LOOPBACK,RUNNING> metric 0 mtu 1500
        inet 172.17.5.1 netmask 0xffffff00
        carp: MASTER vhid 2 advbase 1 advskew 0
```

But, _dmesg_ of Host 1 is

```
arp: --------- is using my IP address 172.17.5.1 on vlan2!
```
similar, dmesg of host 2.

Is that normal? or i did something wrong?


----------



## squirL (Nov 17, 2008)

sibdoma said:
			
		

> I'm using CARP on FreeBSD 7.1-PRERELEASE.
> 
> ```
> sysctl net.inet.carp
> ...


what have u set same adresses (172.17.5.1) on both carp interfaces for??
carp0 must differ from carp1


----------



## sibdoma (Nov 17, 2008)

For _*arpbalancing*_.
From man

```
First the carp interfaces on host A are configured.  The advskew of 100
     on the second virtual host means that its advertisements will be sent out
     slightly less frequently.

           ifconfig carp0 create
           ifconfig carp0 vhid 1 pass mekmitasdigoat 192.168.1.10/24
           ifconfig carp1 create
           ifconfig carp1 vhid 2 advskew 100 pass mekmitasdigoat 192.168.1.10/24

     The configuration for host B is identical, except the advskew is on vir-
     tual host 1 rather than virtual host 2.

           ifconfig carp0 create
           ifconfig carp0 vhid 1 advskew 100 pass mekmitasdigoat 192.168.1.10/24
           ifconfig carp1 create
           ifconfig carp1 vhid 2 pass mekmitasdigoat 192.168.1.10/24

     Finally, the ARP balancing feature must be enabled on both hosts:

           sysctl net.inet.carp.arpbalance=1
```


----------



## squirL (Nov 17, 2008)

nice  please, look to the man once more.

```
carp0: flags=49<UP,LOOPBACK,RUNNING> metric 0 mtu 1500
        inet 172.17.5.1 netmask 0xffffff00
        carp: BACKUP vhid 1 advbase 1 advskew 100

carp1: flags=49<UP,LOOPBACK,RUNNING> metric 0 mtu 1500
        inet 172.17.5.1 netmask 0xffffff00
        carp: BACKUP vhid 2 advbase 1 advskew 100
```
u set the same advskew on both interfaces. i think - it's incorrect. try to set one to 0 for carp1 (host B)

PS: we can discuss your problem in russian using ICQ


----------



## sibdoma (Nov 17, 2008)

squirL said:
			
		

> nice  please, look to the man once more.
> 
> u set the same advskew on both interfaces. i think - it's incorrect. try to set one to 0 for carp1 (host B)
> 
> PS: we can discuss your problem in russian using ICQ


Sorry, I made a mistake when copying. Fixed...


----------



## sibdoma (Nov 20, 2008)

The problem is solved. Thanks to squirL for help.
vlan interfaces and carp interfaces have to have different IP from one subnet, BUT NOT yhe same IP.
Example,

vlan2: flags=8943<UP,BROADCAST,RUNNING,PROMISC,SIMPLEX,MULTICAST> metric 0 mtu 1500
        options=3<RXCSUM,TXCSUM>
        ether 00:30:48:d2:12:07
        inet 172.17.5.253 netmask 0xffffff00 broadcast 172.17.5.255

and

carp0: flags=49<UP,LOOPBACK,RUNNING> metric 0 mtu 1500
        inet 172.17.5.1 netmask 0xffffff00


----------

