0

I try to put in place 2 freebsd routers with carp interfaces. since I have only one wan address, lets say : 1.2.3.4 I'd like to use private range ips to do carp jobs :

10.0.0.1(router1) alias (1.2.3.4) 10.0.0.2 (router2) alias (1.2.3.4)

my ISP gateway is : 1.2.3.5

so when I make a ping 1.2.3.5

ping : sendto : No route to host

which is predictable.

some posts is talking about using pfsense to do the job. But, I only get freebsd one thoses routers. some helps would be apprecied.

thanks

goddard
  • 1
  • 1

2 Answers2

1

You should be able to accomplish this with alias interfaces.

The rc.conf on host 1 would look something like this:

ifconfig_fxp0="inet 10.0.0.1/24"

ifconfig_fxp0_alias0="inet 1.2.3.4/24 vhid 100 pass mekmitasdigoat up"

And on host 2

ifconfig_fxp0="inet 10.0.0.2/24"

ifconfig_fxp0_alias0="inet 1.2.3.4/24 vhid 100 pass mekmitasdigoat advskew 100"

This will work as long as the WAN and private addresses are on different network ranges. You'll have to use /32 subnet masks otherwise, as the Handbook describes. For example, if your WAN address was 10.0.0.3 you'd need this configuration on host 1:

ifconfig_fxp0="inet 10.0.0.1/24"

ifconfig_fxp0_alias0="inet 10.0.0.3/32 vhid 100 pass mekmitasdigoat up"

And on host 2

ifconfig_fxp0="inet 10.0.0.2/24"

ifconfig_fxp0_alias0="inet 10.0.0.3/32 vhid 100 pass mekmitasdigoat advskew 100"

Jose Quinteiro
  • 874
  • 6
  • 9
  • any idea about how to use carp in the same scenario but when the WAN is on a different route (fib) ? – nbari Apr 05 '20 at 15:50
0

I may be wrong, but AFAIK you need three addresses.

OpenBSD has carpdev(4), which removes the need for the additional addresses