Roey Chen efa0d2777b NSXv Admin util: BGP GW edges deployment and configuration
E.g:
 -  Create a BGP gateway edge:

    $ nsxadmin -r bgp-gw-edge -o create \
      --property name=GW-EDGE1 \
      --property local-as=65002 \
      --property external-iface=network-16:192.168.111.16/24 \
      --property internal-iface=virtualwire-223:20.20.20.16/24

 -  Delete edge:

    $ nsxadmin -r bgp-gw-edge -o delete \
    --property edge-id=edge-321

 -  Creates a rule and add it to both edges, if prefix is not given then
    default prefix ('0.0.0.0/0') is used:

    $ nsxadmin -r routing-redistribution-rule -o create \
      --property gw-edge-ids=edge-375,edge-376 \
      --property learner-protocol=bgp \
      --property learn-from=static \
      --property action=permit

 -  Delete all rules created with default prefix on specified edges:

    $ nsxadmin -r routing-redistribution-rule -o delete \
      --property gw-edge-ids=edge-1,edge-2

 - Add a BGP neighbour to specified edges:

    $ nsxadmin -r bgp-neighbour -o create \
      --property gw-edge-ids=edge-1,edge-2 \
      --property ip-address=192.168.1.1 \
      --property remote-as=65002 \
      --property password=Password12#

 - Remove a BGP neighbour from specified edges:
    $ nsxadmin -r bgp-neighbour -o delete \
      --property gw-edge-ids=edge-1,edge-2 \
      --property ip-address=192.168.1.1

Change-Id: Ic18f9657735285de288da8996cc77ae50685f1c4
2017-05-24 01:25:01 -07:00

53 lines
1.7 KiB
Python

# Copyright 2015 VMware, Inc. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
# Default conf file locations
NEUTRON_CONF = '/etc/neutron/neutron.conf'
NSX_INI = '/etc/neutron/plugins/vmware/nsx.ini'
# NSX Plugin Constants
NSXV3_PLUGIN = 'vmware_nsx.plugin.NsxV3Plugin'
NSXV_PLUGIN = 'vmware_nsx.plugin.NsxVPlugin'
VMWARE_NSXV = 'vmware_nsxv'
VMWARE_NSXV3 = 'vmware_nsxv3'
# Common Resource Constants
NETWORKS = 'networks'
ROUTERS = 'routers'
DHCP_BINDING = 'dhcp-binding'
FIREWALL_SECTIONS = 'firewall-sections'
FIREWALL_NSX_GROUPS = 'nsx-security-groups'
SECURITY_GROUPS = 'security-groups'
CONFIG = 'config'
# NSXV3 only Resource Constants
PORTS = 'ports'
METADATA_PROXY = 'metadata-proxy'
ORPHANED_DHCP_SERVERS = 'orphaned-dhcp-servers'
CERTIFICATE = 'certificate'
# NSXV only Resource Constants
EDGES = 'edges'
SPOOFGUARD_POLICY = 'spoofguard-policy'
BACKUP_EDGES = 'backup-edges'
ORPHANED_EDGES = 'orphaned-edges'
MISSING_EDGES = 'missing-edges'
METADATA = 'metadata'
MISSING_NETWORKS = 'missing-networks'
ORPHANED_NETWORKS = 'orphaned-networks'
LBAAS = 'lbaas'
BGP_GW_EDGE = 'bgp-gw-edge'
ROUTING_REDIS_RULE = 'routing-redistribution-rule'
BGP_NEIGHBOUR = 'bgp-neighbour'