Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Configure iptables for IPv6, closes #97 #96

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions includes.container/etc/iptables/rules.v6
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
*filter
:INPUT DROP [0:0]
:FORWARD DROP [0:0]
:OUTPUT ACCEPT [0:0]

# Allow loopback
-A INPUT -i lo -j ACCEPT

# Allow SSH (Port 22)
# -A INPUT -p tcp --dport 22 -j ACCEPT

# Allow enstabilished and related connections
-A INPUT -m conntrack --ctstate ESTABLISHED,RELATED -j ACCEPT

COMMIT
15 changes: 15 additions & 0 deletions includes.container/usr/systemd/system/ip6tables.service
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
[Unit]
Description=ip6tables firewall rules
DefaultDependencies=no
Before=network-pre.target
Wants=network-pre.target

[Service]
Type=oneshot
ExecStart=/sbin/ip6tables-restore /etc/iptables/rules.v6
ExecReload=/sbin/ip6tables-restore /etc/iptables/rules.v6
ExecStop=/sbin/ip6tables-save > /etc/iptables/rules.v6
RemainAfterExit=yes

[Install]
WantedBy=multi-user.target
4 changes: 4 additions & 0 deletions modules/91-iptables.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,7 @@ modules:
type: shell
commands:
- ln -s /usr/lib/systemd/system/iptables.service /etc/systemd/system/multi-user.target.wants/iptables.service
- name: enable-ip6tables-systemd-unit
type: shell
commands:
- ln -s /usr/lib/systemd/system/ip6tables.service /etc/systemd/system/multi-user.target.wants/ip6tables.service
Loading