Dobby 3.0
Dobby “Docker based Thingy” is a tool for managing and running OCI containers using crun
|
Sets up iptables routing to allow apps within a network namespace to talk to the dnsmasq server running outside the container. More...
Functions | |
bool | set (const std::shared_ptr< DobbyRdkPluginUtils > &utils, const std::shared_ptr< Netfilter > &netfilter, const std::shared_ptr< NetworkingHelper > &helper, const std::string &rootfsPath, const std::string &containerId, const NetworkType networkType) |
Add iptables rules and create the /etc/resolv.conf file. | |
bool | removeRules (const std::shared_ptr< Netfilter > &netfilter, const std::shared_ptr< NetworkingHelper > &helper, const std::string &containerId) |
Deletes dnsmasq rules for the container. | |
Sets up iptables routing to allow apps within a network namespace to talk to the dnsmasq server running outside the container.
This works by routing traffic sent to the dobby bridge on port 53 to the localhost interface outside the container.
bool DnsmasqSetup::removeRules | ( | const std::shared_ptr< Netfilter > & | netfilter, |
const std::shared_ptr< NetworkingHelper > & | helper, | ||
const std::string & | containerId | ||
) |
Deletes dnsmasq rules for the container.
Run in postHalt hook.
[in] | netfilter | Instance of Netfilter class |
[in] | helper | Instance of NetworkingHelper. |
[in] | containerId | Container identifier |
bool DnsmasqSetup::set | ( | const std::shared_ptr< DobbyRdkPluginUtils > & | utils, |
const std::shared_ptr< Netfilter > & | netfilter, | ||
const std::shared_ptr< NetworkingHelper > & | helper, | ||
const std::string & | rootfsPath, | ||
const std::string & | containerId, | ||
const NetworkType | networkType | ||
) |
Add iptables rules and create the /etc/resolv.conf file.
Run in createRuntime hook.
Create a new /etc/resolv.conf file specifying the name server as our bridge interface. Add a PREROUTING rule to the iptable NAT table, which will redirect the traffic to localhost outside the container for port 53 only.
[in] | utils | Instance of DobbyRdkPluginUtils class |
[in] | netfilter | Instance of Netfilter class |
[in] | helper | Instance of NetworkingHelper. |
[in] | rootfsPath | Path to container rootfs on the host |
[in] | containerId | Container identifier |
[in] | networkType | Network type |