To configure BGP for ESC HA, there are two options:
-
Directly booting ESC HA L3 with BGP
-
Using post configuration from existing ESC HA pair
To configure BGP for ESC HA, the following network parameters are required:
-
BGP remote IP
-
IP of the interface for BGP anycast routing
-
BGP local AS number for routing configuration
-
BGP remote AS number for routing configuration
-
BGP routing configuration
-
--bgp_local_ip
-
--bgp_local_router_id
Note |
You must configure BGP router with neighbors, and restart it. Verify that the router is able to ping the AnyCast IP.
|
On the BGP router, set two neighbors. The below BGP configuration is designed for Bird router. The configuration is router
specific. For each types of router, the procedure is different:
The below configurations are given according to the bootvm command :protocol bgp E3 from EXABGP {
neighbor 198.18.42.222 as 65012;
}
protocol bgp E4 from EXABGP {
neighbor 198.18.61.222 as 65011;
}
Booting an ESC VM with BGP options ####################################################################
# ESC on bgp-001.novalocal is in MASTER state.
####################################################################
[admin@bgp-001 ~]$ health.sh
============== ESC HA (MASTER) with DRBD =================
vimmanager (pgid 4007) is running
monitor (pgid 4135) is running
mona (pgid 4167) is running
drbd (pgid 0) is master
snmp (pgid 5375) is running
etsi is disabled at startup
pgsql (pgid 4586) is running
keepalived (pgid 3068) is running
portal (pgid 5315) is running
confd (pgid 4417) is running
filesystem (pgid 0) is running
escmanager (pgid 4615) is running
=======================================
ESC HEALTH PASSED
[admin@bgp-001 ~]$
####################################################################
# ESC on bgp-002.novalocal is in BACKUP state.
####################################################################
[admin@bgp-002 ~]$ health.sh
============== ESC HA (BACKUP) with DRBD =================
vimmanager is stopped
monitor is stopped
mona is stopped
drbd (pgid 0) is backup
snmp is stopped
etsi is disabled at startup
pgsql is stopped
keepalived (pgid 3069) is running
portal is stopped
confd is stopped
filesystem is stopped
escmanager is stopped
=======================================
ESC HEALTH PASSED
[admin@bgp-002 ~]$
Use below values for BGP post configuration:
./bootvm.sh <NETWORK_VM_name> \
--image <ESC_image> \
--ipaddr <static_IP_address1> <IP_address2> <IP_address_3>\
--gateway_ip <gateway IP address of NETWORK> \
--net <net_id1> <net_id2> <net_id3> \
--network_params_file <network_params_file> \
--host_mapping_file <host_mapping_file> \
--avail_zone <openStack_zone> \
--bgp_remote_ip <BGP_remote_IP_address> \
--bgp_local_as <BGP_local_AS_#> \
--bgp_remote_as <BGP_remote_AS_#>\
--bgp_local_router_id <local_BGP_reouter_id> \
--bgp_anycast_ip <BGP_anycast_IP> \
--bgp_md5 <BGP_MD5>
Where,
--ip_addr: ----> the local IP address of the ESC VM
--net: ----> the network id(s) in OpenStack that ESC will connect to.
--bgp_anycast_ip: ----> the IP address that NCS will communicate with
--bgp_remote_ip: ----> this IP address of the external router that ESC will peer with
--bgp_local_as: ----> local AS for the ESC "router"
--bgp_remote_as: ----> AS number for the external router ESC will peer with
--bgp_local_router_id: ----> id for the esc "router"
--bgp_md5: ----> optional - md5 to be used to pair with external router
Configuring BGP HA Post Configuration
-
For each HA instance, create the network interface file:
# cat /etc/sysconfig/network-scripts/ifcfg-lo:2
IPV6INIT='no'
IPADDR='10.0.124.124' <------------------ bgp anycast IP
BROADCAST='10.0.124.255'
NETWORK='10.0.124.0'
NETMASK='255.255.255.0'
DEVICE='lo:2'
ONBOOT='yes'
NAME='loopback'
-
For each HA instance:
Bring lo:2 up
# ifup lo:2
To configure BGP for ESC HA, use the escadm tool in ESC Virtual Machine, as shown below:
$ sudo bash
# escadm bgp set --local_ip LOCAL_IP --anycast_ip ANYCAST_IP --remote_ip REMOTE_IP --local_as LOCAL_AS --remote_as REMOTE_AS
--local_router_id LOCAL_ROUTER_ID
# escadm reload
# reboot
Example:[root@bgp-001 admin]# escadm bgp set --local_ip 198.18.42.124 --anycast_ip 10.0.124.124 --remote_ip 192.168.0.2 --local_as 65124 --remote_as 65000 --local_router_id 198.18.42.124
[root@bgp-002 admin]# escadm bgp set --local_ip 198.18.42.125 --anycast_ip 10.0.124.124 --remote_ip 192.168.0.2 --local_as 65114 --remote_as 65000 --local_router_id 198.18.42.125
Configuring a BGP Router To configure a BGP router, log in to the BGP router to configure BGP Anycast routing. The required parameters are:
<Router_AS_#>
same as--bgp_remote_asabove<Esc_ip_address>
must be the ESC VM's IP address configured for BGP advertisement.
<ESC_AS_#>
same as--bgp_local_asshown aboveconfigure
router bgp <Router_AS_#>
neighbor <ESC_IP_address>
remote-as <ESC_AS_#>
address-family ipv6 unicast
route-policy anycast-in in
route-policy anycast-out out
route-policy anycast-in
pass
end-policy
route-policy anycast-out
drop
end-policy
commit