c54f7f612796ea318f312f0455d39cca500cedb9
[openstack-build/neutron-build.git] / neutron / agent / l3 / config.py
1 # Copyright (c) 2015 OpenStack Foundation.
2 #
3 # All Rights Reserved.
4 #
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
8 #
9 #         http://www.apache.org/licenses/LICENSE-2.0
10 #
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
15 #    under the License.
16
17 from oslo_config import cfg
18
19 from neutron._i18n import _
20 from neutron.agent.common import config
21 from neutron.common import constants
22
23
24 OPTS = [
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',
42                 default=9697,
43                 help=_("TCP Port used by Neutron metadata namespace proxy.")),
44     cfg.IntOpt('send_arp_for_ha',
45                default=3,
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',
53                 default=True,
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 "
78                       "these RAs. "
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',
85                default='dibbler',
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 '
90                       'source.')),
91     cfg.BoolOpt('enable_metadata_proxy', default=True,
92                 help=_("Allow running metadata proxy.")),
93     cfg.StrOpt('metadata_access_mark',
94                default='0x1',
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',
99                default='0x2',
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.')),
103 ]
104
105 OPTS += config.EXT_NET_BRIDGE_OPTS