9. Activating Session Table Synchronization with bngsync

This Example shows how to enable the bngsync protocol for session table and GNAT state information synchronisation between two nodes. Please note that bngsync defines a peer relationship between two VRRP nodes, where one is operating as “master” and the other as “backup” (as negotiated by VRRP). Bngsync does not support synchronisation between one master node and more than one backup node.

The bngsync protocol was introduced with BalanceNG 3.540. With BalanceNG V4 we recommend to establish session table synchronisation using this method since the former broadcasting method has several serious disadvantages.

Enabling bngsync over IPv4

In order to enable bngsync over IPv4, the special keyword “network N syncpeer” references the “network N real” IPv4 address of the peer.

Node A configuration excerpt

...
modules   vrrp,arp,ping,hc,master,slb,tnat,nat,rt
set       {
          multithreading 1
          sessionautoresync 1
          sessionsyncack 1
}         
interface 1 {
          name eth0
          access raw
          threads 8
}         
register  interface 1
enable    interface 1
vrrp      {
          vrid 50
          priority 200
          network 1
}         
network   1 {
          name "local network"
          addr 172.17.2.0
          mask 255.255.255.0
          real 172.17.2.101
          virt 172.17.2.100
          mask6 48
          real6 2001:db8:1111::2:1
          virt6 2001:db8:1111::2:0
          syncpeer 172.17.2.102
          interface 1
}         
register  network 1
enable    network 1
...

Node A setup verification

 nodea# show bngsync
  bngsync is active
  we are talking (and expecting) IPv4 UDP port 10439
  the MAC address for syncpeer is known as 06:00:ac:11:02:66
  bngsync IPv4 packets received: 2
  bngsync IPv6 packets received: 0
nodea#

Node B configuration excerpt

...
modules   vrrp,arp,ping,hc,master,slb,tnat,nat,rt
set       {
          multithreading 1
          sessionautoresync 1
          sessionsyncack 1
}         
interface 1 {
          name eth0
          access raw
          threads 8
}         
register  interface 1
enable    interface 1
vrrp      {
          vrid 50
          priority 200
          network 1
}         
network   1 {
          name "local network"
          addr 172.17.2.0
          mask 255.255.255.0
          real 172.17.2.102
          virt 172.17.2.100
          mask6 48
          real6 2001:db8:1111::2:2
          virt6 2001:db8:1111::2:0
          syncpeer 172.17.2.101
          interface 1
}         
register  network 1
enable    network 1
...

Node B setup verification

nodeb# show bngsync
  bngsync is active
  we are talking (and expecting) IPv4 UDP port 10439
  the MAC address for syncpeer is known as 06:00:ac:11:02:65
  bngsync IPv4 packets received: 3
  bngsync IPv6 packets received: 0
nodeb#

Enabling bngsync over IPv6

In order to enable bngsync over IPv6, the special keyword “network N syncpeer” references the “network N real6” IPv6 address of the peer.

Node A configuration excerpt

...
modules   vrrp,arp,ping,hc,master,slb,tnat,nat,rt
set       {
          multithreading 1
          sessionautoresync 1
          sessionsyncack 1
}         
interface 1 {
          name eth0
          access raw
          threads 8
}         
register  interface 1
enable    interface 1
vrrp      {
          vrid 50
          priority 200
          network 1
}         
network   1 {
          name "local network"
          addr 172.17.2.0
          mask 255.255.255.0
          real 172.17.2.101
          virt 172.17.2.100
          mask6 48
          real6 2001:db8:1111::2:1
          virt6 2001:db8:1111::2:0
          syncpeer 2001:db8:1111::2:2
          interface 1
}         
register  network 1
enable    network 1
...

Node A setup verification

nodea# show bngsync
  bngsync is active
  we are talking (and expecting) IPv6 UDP port 10439
  the MAC address for syncpeer is known as 06:01:00:40:39:b2
  bngsync IPv4 packets received: 0
  bngsync IPv6 packets received: 5
nodea#

Node B configuration excerpt

...
modules   vrrp,arp,ping,hc,master,slb,tnat,nat,rt
set       {
          multithreading 1
          sessionautoresync 1
          sessionsyncack 1
}         
interface 1 {
          name eth0
          access raw
          threads 8
}         
register  interface 1
enable    interface 1
vrrp      {
          vrid 50
          priority 200
          network 1
}         
network   1 {
          name "local network"
          addr 172.17.2.0
          mask 255.255.255.0
          real 172.17.2.102
          virt 172.17.2.100
          mask6 48
          real6 2001:db8:1111::2:2
          virt6 2001:db8:1111::2:0
          syncpeer 2001:db8:1111::2:1
          interface 1
}         
register  network 1
enable    network 1
...

Node B setup verification

nodeb# show bngsync
  bngsync is active
  we are talking (and expecting) IPv6 UDP port 10439
  the MAC address for syncpeer is known as 06:01:00:e5:be:34
  bngsync IPv4 packets received: 0
  bngsync IPv6 packets received: 7
nodeb#