# Carp and default route



## Vener (Apr 20, 2010)

Hello,

I'm using carp with a FreeBSD 8.0 server and I have a routing problem.

I have modified my rc.conf like this :


```
ifconfig_bce0="172.16.40.34 255.255.255.0"
ifconfig_bce0_alias0="172.16.40.35/32"
ifconfig_bce0_alias1="172.16.40.36/32"
defaultrouter="172.16.40.101"
gateway_enable="yes"

#       CARP

cloned_interfaces="carp0"
ifconfig_carp0="vhid 1 pass rPth3d74Wz 172.16.40.37/24"
#ifconfig_carp1="vhid 2 advskew 100 pass rPth3d74Wz 172.16.40.38/24"

#       pfsync

pfsync_enable="YES"
pfsync_syncdev="bce1"
pfsync_syncpeer="172.16.41.100"
```

And once the server has boot, fconfig give me this :


```
==> ifconfig 
[B]bce0[/B]: flags=8943<UP,BROADCAST,RUNNING,PROMISC,SIMPLEX,MULTICAST> metric 0 mtu 1500
	options=1bb<RXCSUM,TXCSUM,VLAN_MTU,VLAN_HWTAGGING,JUMBO_MTU,VLAN_HWCSUM,TSO4>
	ether 00:19:b9:d8:4a:05
	inet 172.16.40.34 netmask 0xffff0000 broadcast 255.255.255.0
	inet 172.16.40.35 netmask 0xffffffff broadcast 172.16.40.35
	inet 172.16.40.36 netmask 0xffffffff broadcast 172.16.40.36
	media: Ethernet autoselect (100baseTX <full-duplex>)
	status: active
[B]bce1[/B]: flags=8802<BROADCAST,SIMPLEX,MULTICAST> metric 0 mtu 1500
	options=1bb<RXCSUM,TXCSUM,VLAN_MTU,VLAN_HWTAGGING,JUMBO_MTU,VLAN_HWCSUM,TSO4>
	ether 00:19:b9:d8:4a:03
	media: Ethernet autoselect (none)
	status: no carrier
[B]pfsync0[/B]: flags=41<UP,RUNNING> metric 0 mtu 1460
	pfsync: syncdev: bce1 syncpeer: 172.16.41.100 maxupd: 128
[B]lo0[/B]: flags=8049<UP,LOOPBACK,RUNNING,MULTICAST> metric 0 mtu 16384
	options=3<RXCSUM,TXCSUM>
	inet6 fe80::1%lo0 prefixlen 64 scopeid 0x4 
	inet6 ::1 prefixlen 128 
	inet 127.0.0.1 netmask 0xff000000 
	nd6 options=3<PERFORMNUD,ACCEPT_RTADV>
[B]pflog0[/B]: flags=141<UP,RUNNING,PROMISC> metric 0 mtu 33152
[B]carp0[/B]: flags=49<UP,LOOPBACK,RUNNING> metric 0 mtu 1500
	inet 172.16.40.37 netmask 0xffffff00 
	carp: MASTER vhid 1 advbase 1 advskew 0
```

It seems to be ok, but carp0 is the default route interface : 

```
==> netstat -rn
Routing tables

Internet:
Destination        Gateway            Flags    Refs      Use  Netif Expire
[B]default            172.16.40.101      UGS         0        0  carp0[/B]
127.0.0.1          link#4             UH          0       12    lo0
172.16.0.0/16      link#1             U           8       88   bce0
172.16.40.34       link#1             UHS         0        0    lo0
172.16.40.35       link#1             UHS         0       31    lo0 =>
172.16.40.35/32    link#1             U           0        0   bce0
172.16.40.36       link#1             UHS         0       22    lo0 =>
172.16.40.36/32    link#1             U           0        0   bce0
172.16.40.37       link#6             UH          0        0  carp0
```

And the server is logically unreachable from another subnet.

I don't understand why he doesn't use bce0 as the default route interface and I don't know how to handle this.

May anyone have an idea ?

Thank you.


----------



## DutchDaemon (Apr 20, 2010)

OpenBSD, but similar enough, it seems: http://www.mail-archive.com/misc@openbsd.org/msg72509.html


----------



## Vener (Apr 20, 2010)

Yes, it seems to be the same thing. I'll watch this tomorrow morning.

Thank you.


----------

