API to Force Bond Link Switchover
SUMMARY Read this topic to learn about the L2 feature in the Juniper Cloud-Native Router that is used to force traffic to switch from the active interface to the standby interface in a bonded pair using REST API.
API to Force Bond Link Switchover
When you run cloud-native router in L2 mode with cascaded nodes you can configure those nodes to use bond interfaces. If you configure the bond interfaces in theACTIVE_BACKUP
mode,
the vRouter-agent exposes the REST API call: curl -X POST
http://127.0.0.1:9091/bond-switch/bond0
on localhost port 9091. You can use this
REST API call to force traffic to switch from the active interface to the standby interface. Configuration Example
You can configure the bond mode in thevalues.yaml
file before deployment. For
example:bondInterfaceConfigs: - name: "bond0" mode: 1 # ACTIVE_BACKUP MODE slaveInterfaces: - "enp59s0f0v0" - "enp59s0f0v1"
dpdkinfo -b
and dpdkinfo -n
respectively.
[[root@jcnr-01 /]# dpdkinfo -b No. of bond slaves: 2 Bonding Mode: Active Backup Transmit Hash Policy: Layer 2 (Ethernet MAC) MII status: UP MII Link Speed: 10000 Mbps Up Delay (ms): 0 Down Delay (ms): 0 Driver: net_bonding Slave Interface(0): 0000:17:01.0 Slave Interface Driver: net_iavf Slave Interface (0): Active Slave Interface Mac : 6E: BD: 45:0F: 4A:02 MII status: UP MII Link Speed: 10000 Mbps Slave Interface (1): 0000:17:11.0 Slave Interface Driver: net_iavf Slave Interface Mac 6E: BD: 45:0F: 4A: C2 MII status: UP MII Link Speed: 25000 Mbps
[root@jcnr-01 /]# dpdkinfo -n2 Master Info (eth_bond_bond0): RX Device Packets: 72019, Bytes: 96419113, Errors:0, Nombufs:0 Dropped RX Packets: 37475 TX Device Packets:0, Bytes:0, Errors:0 Queue Rx: Tx: Rx Bytes: Tx Bytes: Errors: Slave Info (0000:17:01.0): Rx Device Packets: 72019, Bytes:66073908, Errors:0, Nombufs:0 Dropped RX Packets: 588 TX Device Packets:0, Bytes:0, Errors:0 Queue Rx: Tx: Rx Bytes: Tx Bytes: Errors: Slave Info (0000:17:11.0): RX Device Packets:0, Bytes:30345205, Errors:0, Nombufs:0 Dropped R Packets:36887 TX Device Packets:0, Bytes:0, Errors:0 Queue Rx: Tx: Rx Bytes: Tx Bytes: Errors: