Skip to content

Commit a50c17b

Browse files
committed
Added ip6tables & fixed sudo permissions
Added ip6tables to container, updated sudo permissions
1 parent ae8801e commit a50c17b

File tree

5 files changed

+20
-4
lines changed

5 files changed

+20
-4
lines changed

CHANGELOG.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
11
# Changelog
22

3-
### 1.0.5 - Bugfix, finish hook, persistent interface, no firewall
3+
### 1.0.5 - Bugfix, finish hook, persistent interface, no firewall ...
44

55
- Fixed bug when running hooks (#3)
66
- Added **finish** hook (which runs just before container exit)
77
- Added **persistent interface** option, so interface is persistently present on device (if using host networking mode) and firewall setup rules are executed **only once** (no ip tables mess) (#1)
88
- Logging chaned to stdout, no more log file by default
99
- Added **firewall disable** feature to disable all firewall related modifications
10+
- Added `ìp6tables` & more permissions to *ip utils*
1011

1112
### 1.0.4 - IPv6 docs, improved wizards
1213

Dockerfile

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,15 +55,18 @@ ENV PATH="/app/bin:$PATH" \
5555
RUN echo "http://dl-cdn.alpinelinux.org/alpine/edge/main/" >> /etc/apk/repositories && \
5656
apk add --no-cache \
5757
# Core packages
58-
bash sudo iptables git openvpn easy-rsa && \
58+
bash sudo iptables ip6tables git openvpn easy-rsa && \
5959
# Link easy-rsa in bin directory
6060
ln -s ${EASYRSA}/easyrsa /usr/local/bin && \
6161
# Link python3 also as python
6262
ln -s /usr/bin/python3 /usr/bin/python && \
6363
# Remove any temporary files created by apk
6464
rm -rf /tmp/* /var/tmp/* /var/cache/apk/* /var/cache/distfiles/* && \
6565
# Add permission for network management to user abc
66-
echo "abc ALL=(ALL) NOPASSWD: /sbin/ip, /sbin/iptables" >> /etc/sudoers
66+
echo "abc ALL=(ALL) NOPASSWD: /sbin/ip, /sbin/ip6tables, /sbin/ip6tables-compat, /sbin/ip6tables-compat-restore, /sbin/ip6tables-compat-save, /sbin/ip6tables-restore, /sbin/ip6tables-restore-translate, \
67+
/sbin/ip6tables-save, /sbin/ip6tables-translate, /sbin/iptables, /sbin/iptables-compat, /sbin/iptables-compat-restore, /sbin/iptables-compat-save, \
68+
/sbin/iptables-restore, /sbin/iptables-restore-translate, /sbin/iptables-save, /sbin/iptables-translate, /sbin/route" \
69+
>> /etc/sudoers.d/abc
6770

6871
# Add repo files to image
6972
COPY root/ /

root/defaults/example/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,4 +94,4 @@ Hooks are located in `hook` directory. Please follow hook guidelines:
9494
- What this hook does
9595
- Setttings with comments and an example settings values
9696
97-
**Note:** All hooks run as non-root user so instead of using `ip` and `iptables` use `ovpn-ip` and `ovpn-iptables`.
97+
**Note:** All hooks run as non-root user so instead of using `ip` and `iptables` use `ovpn-ip`, `ovpn-iptables`, `ovpn-ip6tables` (see [/root/usr/local/sbin](/usr/local/sbin)).

root/usr/local/sbin/ovpn-ip6tables

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
#!/bin/bash
2+
3+
#
4+
# Modify iptables without root user
5+
#
6+
sudo /sbin/ip6tables "$@"

root/usr/local/sbin/ovpn-route

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
#!/bin/bash
2+
3+
#
4+
# Modify iptables without root user
5+
#
6+
sudo /sbin/route "$@"

0 commit comments

Comments
 (0)