// interface the query came in. This is the default ("same-as-inbound").
// However, sometimes it is useful to have the ability to send the
// packet as plain UDP packet and let the kernel and the routing tables
- // to determine the right interface ("use-routing"). This option is
- // expected to work only for dhcp-socket-type set to udp.
+ // determine the right interface ("use-routing"). This option only works
+ // for "dhcp-socket-type" set to "udp" and is ignored otherwise.
"outbound-interface": "use-routing",
// This makes interfaces to be re-detected at each (re-)configuration.
fall back to use IP/UDP sockets.</para>
</note>
- <para>In typical environment the DHCP server is expected to send back its
- responses on the same network interface as the query packets come in. This is
- the default behavior. However, in some deployments it is expected the outbound
- (response) packets will be sent as regular traffic and the outbound interface
- will be determined by the routing tables. This kind of asymetric traffic
- is uncommon, but valid. Kea now supports a parameter called
- <command>outbound-interface</command> that control this behavior. It supports
+ <para>In typical environment the DHCP server is expected to send back a
+ response on the same network interface on which the query is received. This is
+ the default behavior. However, in some deployments it is desired that the
+ outbound (response) packets will be sent as regular traffic and the outbound
+ interface will be determined by the routing tables. This kind of asymetric
+ traffic is uncommon, but valid. Kea now supports a parameter called
+ <command>outbound-interface</command> that controls this behavior. It supports
two values. The first one, <userinput>same-as-inbound</userinput>, tells Kea
- to send back the response on the same inteface the query packet came in. This
+ to send back the response on the same inteface the query packet is received. This
is the default behavior. The second one, <userinput>use-routing</userinput>
tells Kea to send regular UDP packets and let the kernel's routing table to
- determine most appropriate interface. This only works when dhcp-socket-type is
- set to udp. An example configuration looks as follows:
+ determine most appropriate interface. This only works when
+ <command>dhcp-socket-type</command> is set to <userinput>udp</userinput>.
+ An example configuration looks as follows:
<screen>
"Dhcp4": {
"interfaces-config": {
std::string
CfgIface::outboundTypeToText() const {
switch (outbound_iface_) {
- case SAME_AS_INBOUND: return ("same-as-inbound");
- case USE_ROUTING: return ("use-routing");
- default: isc_throw(Unexpected, "unsupported outbound-type " << socket_type_);
+ case SAME_AS_INBOUND:
+ return ("same-as-inbound");
+ case USE_ROUTING:
+ return ("use-routing");
+ default:
+ isc_throw(Unexpected, "unsupported outbound-type " << socket_type_);
}
}
}
void
-CfgIface::setOutboundIface(const OutboundIface& traffic_type) {
+CfgIface::setOutboundIface(const OutboundIface& outbound_iface) {
outbound_iface_ = traffic_type;
}
SOCKET_UDP
};
+ /// @brief Indicates how outbound interface is selected for relayed traffic.
enum OutboundIface {
+ /// Server sends responses over the same interface on which queries are
+ /// received.
SAME_AS_INBOUND,
-
+ /// Server uses routing to determine the right interface to send response.
USE_ROUTING
};
/// @brief Returns the socket type in the textual format.
std::string socketTypeToText() const;
- /// @brief Sets outbound interface type
+ /// @brief Sets outbound interface selection mode.
///
- /// @param traffic_type sets the type of traffic
- void setOutboundIface(const OutboundIface& traffic_type);
+ /// @param outbound_iface New outbound interface selection mode setting.
+ void setOutboundIface(const OutboundIface& outbound_iface);
- /// @brief Returns outbound interface traffic type
+ /// @brief Returns outbound interface selection mode.
///
- /// @return type of traffic (use-routing or same-as-inbound)
+ /// @return Outbound interface selection mode.
OutboundIface getOutboundIface() const;
- /// @brief Returns outbound type as string
+ /// @brief Returns outbound interface selection mode as string.
///
- /// @return text representation of the outbound type
+ /// @return text representation of the outbound interface selection mode.
std::string outboundTypeToText() const;
- /// @brief Converts text to outbound interface
+ /// @brief Converts text to outbound interface selection mode.
+ ///
/// @param txt either 'same-as-inbound' or 'use-routing'
- /// @return converted value
+ /// @return Outbound interface selection mode.
static OutboundIface textToOutboundIface(const std::string& txt);
/// @brief Converts the socket type in the textual format to the type
/// @brief A boolean value which reflects current re-detect setting
bool re_detect_;
+ /// @brief Indicates how outbound interface is selected for relayed traffic.
OutboundIface outbound_iface_;
};