-
Notifications
You must be signed in to change notification settings - Fork 24
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #958 from proditis/master
Improvements to the docs, playbook and docker related files
- Loading branch information
Showing
11 changed files
with
121 additions
and
42 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
#!/bin/bash | ||
# | ||
# https://github.com/deitch/ctables | ||
# | ||
NSPID=${1} | ||
LINKFILE="/var/run/netns/${NSPID}" | ||
mkdir -p /var/run/netns | ||
/bin/rm -f "$LINKFILE" | ||
ln -s "/proc/$NSPID/ns/net" "$LINKFILE" | ||
ip netns exec ${NSPID} iptables -I INPUT -j REJECT | ||
ip netns exec ${NSPID} iptables -I INPUT -i lo -j ACCEPT | ||
ip netns exec ${NSPID} iptables -I INPUT -m conntrack --ctstate ESTABLISHED,RELATED -j ACCEPT | ||
ip netns exec ${NSPID} iptables -I INPUT -s 10.0.0.0/24 -j ACCEPT | ||
ip netns exec ${NSPID} iptables -I INPUT -s 10.10.0.0/16 -j ACCEPT | ||
ip netns exec ${NSPID} iptables -I OUTPUT -o lo -j ACCEPT | ||
ip netns exec ${NSPID} iptables -A OUTPUT -m conntrack --ctstate ESTABLISHED -j ACCEPT | ||
/bin/rm -f "$LINKFILE" | ||
#. /etc/docker-extras.sh | ||
#if [ -f /proc/$NSPID/root/usr/bin/pkexec ]; then | ||
# chmod -s /proc/$NSPID/root/usr/bin/pkexec | ||
#fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
# /etc/systemd/system/docker.service.d/override.conf | ||
[Service] | ||
ExecStart= | ||
ExecStart=/usr/bin/dockerd -H unix:// -H tcp://0.0.0.0:2376 | ||
ExecStart=/usr/bin/dockerd |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,27 +1,6 @@ | ||
# interfaces(5) file used by ifup(8) and ifdown(8) | ||
|
||
# Please note that this file is written to be used with dhcpcd | ||
# For static IP, consult /etc/dhcpcd.conf and 'man dhcpcd.conf' | ||
|
||
# Include files from /etc/network/interfaces.d: | ||
source-directory /etc/network/interfaces.d | ||
|
||
auto lo | ||
iface lo inet loopback | ||
|
||
auto eth0 | ||
iface eth0 inet static | ||
address {{ansible_host}} | ||
netmask {{ansible_default_ipv4.netmask}} | ||
gateway {{ansible_default_ipv4.gateway}} | ||
|
||
allow-hotplug wlan0 | ||
iface wlan0 inet manual | ||
wpa-conf /etc/wpa_supplicant/wpa_supplicant.conf | ||
|
||
allow-hotplug wlan1 | ||
iface wlan1 inet manual | ||
wpa-conf /etc/wpa_supplicant/wpa_supplicant.conf | ||
|
||
# Include files from /etc/network/interfaces.d: | ||
source-directory /etc/network/interfaces.d | ||
auto {{network.driver_options.parent}} | ||
iface {{network.driver_options.parent}} inet static | ||
address {{ipv4}}/16 | ||
gateway {{network.ipam_options[0].gateway}} | ||
up ip link set {{network.driver_options.parent}} promisc on | ||
mtu 1450 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
# Generated by iptables-save v1.6.0 on Mon Sep 14 11:19:43 2020 | ||
*nat | ||
:PREROUTING ACCEPT [0:0] | ||
:INPUT ACCEPT [0:0] | ||
:OUTPUT ACCEPT [0:0] | ||
:POSTROUTING ACCEPT [0:0] | ||
:DOCKER - [0:0] | ||
-A PREROUTING -m addrtype --dst-type LOCAL -j DOCKER | ||
-A OUTPUT ! -d 127.0.0.0/8 -m addrtype --dst-type LOCAL -j DOCKER | ||
-A POSTROUTING -s 172.17.0.0/16 ! -o docker0 -j MASQUERADE | ||
-A DOCKER -i docker0 -j RETURN | ||
COMMIT | ||
# Completed on Mon Sep 14 11:19:43 2020 | ||
# Generated by iptables-save v1.6.0 on Mon Sep 14 11:19:43 2020 | ||
*filter | ||
:INPUT ACCEPT [2:104] | ||
:FORWARD DROP [0:0] | ||
:OUTPUT ACCEPT [49:13320] | ||
:DOCKER - [0:0] | ||
:DOCKER-ISOLATION-STAGE-1 - [0:0] | ||
:DOCKER-ISOLATION-STAGE-2 - [0:0] | ||
:DOCKER-USER - [0:0] | ||
-A INPUT -i lo -j ACCEPT | ||
-A INPUT -d 127.0.0.0/8 ! -i lo -j REJECT --reject-with icmp-port-unreachable | ||
{% for dict_item in PF_TABLES.target_network_ranges %} | ||
-A INPUT -s {{dict_item}} -d {{ipv4}}/32 -j REJECT --reject-with icmp-port-unreachable | ||
{% endfor %} | ||
-A FORWARD -j DOCKER-USER | ||
-A FORWARD -j DOCKER-ISOLATION-STAGE-1 | ||
-A FORWARD -o docker0 -m conntrack --ctstate RELATED,ESTABLISHED -j ACCEPT | ||
-A FORWARD -o docker0 -j DOCKER | ||
-A FORWARD -i docker0 ! -o docker0 -j ACCEPT | ||
-A FORWARD -i docker0 -o docker0 -j ACCEPT | ||
-A DOCKER-ISOLATION-STAGE-1 -i docker0 ! -o docker0 -j DOCKER-ISOLATION-STAGE-2 | ||
-A DOCKER-ISOLATION-STAGE-1 -j RETURN | ||
-A DOCKER-ISOLATION-STAGE-2 -o docker0 -j DROP | ||
-A DOCKER-ISOLATION-STAGE-2 -j RETURN | ||
-A DOCKER-USER -j RETURN | ||
COMMIT | ||
# Completed on Mon Sep 14 11:19:43 2020 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters