View Single Post
  #3   (View Single Post)  
Old 15th April 2009
jggimi's Avatar
jggimi jggimi is offline
More noise than signal
 
Join Date: May 2008
Location: USA
Posts: 7,983
Default

Here's an example. Source: carp(4) and the carp section of ifconfig(8).

Standard network admin knowledge assumed, such as setting packet forwarding on, and setting route tables in the clients (for this test).

Using your ASCII graphic. Assuming failover, no load balancing, and the left router is the default master. NAT is not used in this example.

top client: NIC set to 10.1.0.1/24
bottom client: NIC set to 10.2.0.1/24

left router: top NIC set to 10.1.0.3/24, bottom NIC to 10.2.0.3/24
right router: top NIC set to 10.1.0.4/24, bottom NIC to 10.2.0.4/24

The routers will share redundant addresses 10.x.0.2.

left router:

# sysctl net.inet.carp.preempt=1 (see carp man page)
# ifconfig carp0 vhid 1 10.1.0.2/24
# ifconfig carp1 vhid 2 10.2.0.2/24

right router:

# sysctl net.inet.carp.preempt=1
# ifconfig carp0 vhid 1 10.1.0.2/24 advskew 100
# ifconfig carp1 vhid 2 10.2.0.2/24 advskew 100

Tested with a little network of virtual machines on a windows box at work. Load balancing, NAT, PF, pfsync(4) are left to the poster to uncover and learn.

Last edited by jggimi; 15th April 2009 at 05:43 PM. Reason: found a typo (missing ".") in one of the ifconfig commands.
Reply With Quote