Configuring BGP on a vRouter
Border Gateway Protocol (BGP) is a path-vector protocol and the most commonly used routing protocol on the Internet. BGP advertises the paths required to reach a certain destination. BGP resides on top of TCP, and simpler to configure than Open Shortest Path First (OSPF). In Figure 1  Configuring BGP for Two VLANs, you want network traffic from the source host to reach the destination host. But when you configure different VLANs, the source host traffic becomes unaware of the route between the source host and the destination host. However, a VLAN spans VLAN 33 and VLAN 55. You solve this problem by configuring BGP in the same Autonomous System (AS) 100 sending traffic over VLAN 35. This allows the source host to learn the route to the destination host.
Using a loopback address for peering is useful when multiple paths exist between the BGP peers which would otherwise tear down the BGP session if the physical interface used for establishing the session goes down. It also allows the vRouters running BGP with multiple links between them to load balance over the available paths.
 
Figure 1: Configuring BGP for Two VLANs
This example assumes you have two VLANs, VLAN33 and VLAN55. Also, you have added ports to the configuration.
Begin by configuring vRouter1, a software vRouter, on VLAN 33 with the BGP information:
CLI network-admin@Leaf1 > vrouter-create name vrouter1 fabricname-global router-type hardware bgp-as 100 bgp-redist-connected-metric none
Additional BGP parameters include the following:
bgp-redist-static-metric — redistribute static BGP route metric number
bgp-redist-connected-metric — redistribute connected BGP route metric
bgp-redist-rip-metric — redistribute BGP into RIP process metric
bgp-redist-ospf-metric — redistribute BGP into OSPF process metric
bgp-cluster-id — the ID assigned to the BGP cluster.
bgp-ibgp-multipath — allow the IBGP vRouter to select multiple paths for load sharing
bgp-max-paths — allow the EBGP vRouter to select multiple paths for load sharing.
bgp-bestpath-as-path — allow BGP to use the best path for traffic forwarding
bgp-dampening|no-bgp-dampening — suppress flapping routes so they are not advertised.
bgp-stalepath-time — how long a router waits before deleting stale routes after an end of RIB marker (EOR) message is received from the restarting router.
 
Add the IP addresses and VLANs:
CLI network-admin@Leaf1 > vrouter-interface-add vrouter-name vrouter1 ip 10.16.35.33/24 vlan 35
CLI network-admin@Leaf1 > vrouter-interface-add vrouter-name vrouter1 ip 10.16.33.1/24 vlan 33
Add the BGP information:
CLI network-admin@Leaf1 > vrouter-bgp-add vrouter-name vrouter1 neighbor 10.16.35.55 remote-as 100
CLI network-admin@Leaf1 > vrouter-bgp-add vrouter-name vrouter1 network 10.16.33.0/24
Display the interface information for vrouter1:
CLI network-admin@Leaf1 > vrouter-interface-show format all layout vertical
vrouter-name: vrouter1
nic: eth1.33
ip: 10.9.100.100/16
assignment: static
mac: 66:0e:94:30:c6:92
vlan: 33
vxlan: 0
if: data
alias-on:
exclusive: no
nic-config: enable
nic-state: up
secondary-macs:
vrouter-name: vrouter1
nic: eth2.33
ip: 192.168.42.11/24
assignment: static
mac: 66:0e:94:30:25:5e
vlan: 33
vxlan: 0
if: data
alias-on:
exclusive: no
nic-config: enable
nic-state: up
secondary-macs:
 
To filter IP hosts, add prefix lists to the BGP configuration. See Configuring Prefix Lists for BGP and OSPF.
Then, configure vRouter2 on VLAN 55:
CLI network-admin@Leaf1 > vrouter-create name vrouter2 fabricname-global router-type hardware bgp-as 100 bgp-redist-connected-metric none
Add the IP addresses and VLANs:
CLI network-admin@Leaf1 > vrouter-interface-add vrouter-name vrouter2 ip 10.16.35.55/24 vlan 35
CLI network-admin@Leaf1 > vrouter-interface-add vrouter-name vrouter2 ip 10.16.55.1/24 vlan 55
Then add the BGP information:
CLI network-admin@Leaf1 > vrouter-bgp-add vrouter-name vrouter2 neighbor 10.16.35.33 remote-as 100
CLI network-admin@Leaf1 > vrouter-bgp-add vrouter-name vrouter2 network 10.16.55.0/24
And finally, add the loopback address:
CLI network-admin@Leaf1 > vrouter-loopback-interface-add vrouter-name vrouter1 index 5 ip 1.1.1.1
Netvisor ONE uses the index value as a number to uniquely identifies the vRouter in the AS.
Display the vRouter BGP configuration:
CLI network-admin@Leaf1 > vrouter-bgp-show format all layout vertical
vrouter-name: vrouter33
ip: 10.16.35.55
neighbor: 10.16.35.55
remote-as: 100
next-hop-self: no
route-reflector-client: no
override-capability: no
soft-reconfig-inbound: no
max-prefix-warn-only: no
vrouter-name: vrouter33
ip:                     10.16.33.0
network: 10.16.33.0/24
vrouter-name: vrouter55
ip: 10.16.35.33
neighbor: 10.16.35.33
remote-as: 100
next-hop-self: no
route-reflector-client: no
override-capability: no
soft-reconfig-inbound: no
max-prefix-warn-only: no
vrouter-name: vrouter55
ip: 10.16.55.0
network: 10.16.55.0/24
 
To reset BGP neighbors, use the vrouter-bgp-neighbor-reset command.
To display BGP neighbors, use the vrouter-bgp-neighbor-show command.
CLI network-admin@switch > vrouter-bgp-neighbor-show
vrouter-name: vrouter1
neighbor: 10.9.100.201
ver: 4
remote-as: 100
msg_rcvd: 11
msg_sent: 19
tblver: 0
inQ: 0
outQ: 0
up/down: 00:54:04
state/pfxrcd: Connect
vrouter-name: vrouter2
neighbor: 10.9.100.101
ver: 4
remote-as: 100
msg_rcvd: 12
msg_sent: 18
tblver: 0
inQ: 0
outQ: 0
up/down: 00:53:37
state/pfxrcd: Connect