1 # Copyright (c) 2015 OpenStack Foundation.
5 # Licensed under the Apache License, Version 2.0 (the "License"); you may
6 # not use this file except in compliance with the License. You may obtain
7 # a copy of the License at
9 # http://www.apache.org/licenses/LICENSE-2.0
11 # Unless required by applicable law or agreed to in writing, software
12 # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
13 # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
14 # License for the specific language governing permissions and limitations
17 from oslo_config import cfg
19 from neutron._i18n import _
20 from neutron.agent.common import config
21 from neutron.common import constants
25 cfg.StrOpt('agent_mode', default=constants.L3_AGENT_MODE_LEGACY,
26 choices=(constants.L3_AGENT_MODE_DVR,
27 constants.L3_AGENT_MODE_DVR_SNAT,
28 constants.L3_AGENT_MODE_LEGACY),
29 help=_("The working mode for the agent. Allowed modes are: "
30 "'legacy' - this preserves the existing behavior "
31 "where the L3 agent is deployed on a centralized "
32 "networking node to provide L3 services like DNAT, "
33 "and SNAT. Use this mode if you do not want to "
34 "adopt DVR. 'dvr' - this mode enables DVR "
35 "functionality and must be used for an L3 agent "
36 "that runs on a compute host. 'dvr_snat' - this "
37 "enables centralized SNAT support in conjunction "
38 "with DVR. This mode must be used for an L3 agent "
39 "running on a centralized node (or in single-host "
40 "deployments, e.g. devstack)")),
41 cfg.PortOpt('metadata_port',
43 help=_("TCP Port used by Neutron metadata namespace proxy.")),
44 cfg.IntOpt('send_arp_for_ha',
46 help=_("Send this many gratuitous ARPs for HA setup, if "
47 "less than or equal to 0, the feature is disabled")),
48 cfg.StrOpt('router_id', default='',
49 deprecated_for_removal=True,
50 help=_("If non-empty, the l3 agent can only configure a router "
51 "that has the matching router ID.")),
52 cfg.BoolOpt('handle_internal_only_routers',
54 help=_("Indicates that this L3 agent should also handle "
55 "routers that do not have an external network gateway "
56 "configured. This option should be True only for a "
57 "single agent in a Neutron deployment, and may be "
58 "False for all agents if all routers must have an "
59 "external network gateway.")),
60 cfg.StrOpt('gateway_external_network_id', default='',
61 help=_("When external_network_bridge is set, each L3 agent can "
62 "be associated with no more than one external network. "
63 "This value should be set to the UUID of that external "
64 "network. To allow L3 agent support multiple external "
65 "networks, both the external_network_bridge and "
66 "gateway_external_network_id must be left empty.")),
67 cfg.StrOpt('ipv6_gateway', default='',
68 help=_("With IPv6, the network used for the external gateway "
69 "does not need to have an associated subnet, since the "
70 "automatically assigned link-local address (LLA) can "
71 "be used. However, an IPv6 gateway address is needed "
72 "for use as the next-hop for the default route. "
73 "If no IPv6 gateway address is configured here, "
74 "(and only then) the neutron router will be configured "
75 "to get its default route from router advertisements "
76 "(RAs) from the upstream router; in which case the "
77 "upstream router must also be configured to send "
79 "The ipv6_gateway, when configured, should be the LLA "
80 "of the interface on the upstream router. If a "
81 "next-hop using a global unique address (GUA) is "
82 "desired, it needs to be done via a subnet allocated "
83 "to the network and not through this parameter. ")),
84 cfg.StrOpt('prefix_delegation_driver',
86 help=_('Driver used for ipv6 prefix delegation. This needs to '
87 'be an entry point defined in the '
88 'neutron.agent.linux.pd_drivers namespace. See '
89 'setup.cfg for entry points included with the neutron '
91 cfg.BoolOpt('enable_metadata_proxy', default=True,
92 help=_("Allow running metadata proxy.")),
93 cfg.StrOpt('metadata_access_mark',
95 help=_('Iptables mangle mark used to mark metadata valid '
96 'requests. This mark will be masked with 0xffff so '
97 'that only the lower 16 bits will be used.')),
98 cfg.StrOpt('external_ingress_mark',
100 help=_('Iptables mangle mark used to mark ingress from '
101 'external network. This mark will be masked with '
102 '0xffff so that only the lower 16 bits will be used.')),
105 OPTS += config.EXT_NET_BRIDGE_OPTS