mirror of
https://github.com/vimagick/dockerfiles.git
synced 2025-12-21 21:33:02 +01:00
add iptables
This commit is contained in:
@@ -11,7 +11,6 @@ dockerfiles
|
|||||||
- [ ] freegeoip
|
- [ ] freegeoip
|
||||||
- [ ] gitolite
|
- [ ] gitolite
|
||||||
- [ ] hashcat
|
- [ ] hashcat
|
||||||
- [ ] iptables
|
|
||||||
- [ ] irc
|
- [ ] irc
|
||||||
- [ ] tshark
|
- [ ] tshark
|
||||||
|
|
||||||
@@ -38,6 +37,7 @@ dockerfiles
|
|||||||
- [x] hubot
|
- [x] hubot
|
||||||
- [x] hydra
|
- [x] hydra
|
||||||
- [x] influxdb
|
- [x] influxdb
|
||||||
|
- [x] iptables
|
||||||
- [x] joomla
|
- [x] joomla
|
||||||
- [x] mantisbt
|
- [x] mantisbt
|
||||||
- [x] monit
|
- [x] monit
|
||||||
|
|||||||
21
iptables/Dockerfile
Normal file
21
iptables/Dockerfile
Normal file
@@ -0,0 +1,21 @@
|
|||||||
|
#
|
||||||
|
# Dockerfile for iptables
|
||||||
|
#
|
||||||
|
|
||||||
|
FROM alpine
|
||||||
|
MAINTAINER kev <noreply@datageek.info>
|
||||||
|
|
||||||
|
RUN apk add -U iproute2
|
||||||
|
|
||||||
|
ENV TCP_PORTS 80,443
|
||||||
|
ENV UDP_PORTS 53
|
||||||
|
ENV RATE 1mbit
|
||||||
|
ENV BURST 1mbit
|
||||||
|
ENV LATENCY 50ms
|
||||||
|
ENV INTERVAL 60
|
||||||
|
|
||||||
|
CMD iptables -F \
|
||||||
|
&& iptables -A OUTPUT -p tcp -m state --state NEW -m multiport ! --dports $TCP_PORTS -j DROP \
|
||||||
|
&& iptables -A OUTPUT -p udp -m state --state NEW -m multiport ! --dports $UDP_PORTS -j DROP \
|
||||||
|
&& tc qdisc add dev eth0 root tbf rate $RATE burst $BURST latency $LATENCY \
|
||||||
|
&& watch -n $INTERVAL tc -s qdisc ls dev eth0
|
||||||
31
iptables/README.md
Normal file
31
iptables/README.md
Normal file
@@ -0,0 +1,31 @@
|
|||||||
|
iptables
|
||||||
|
========
|
||||||
|
|
||||||
|
- iptables: filter ports
|
||||||
|
- tc: control traffic
|
||||||
|
|
||||||
|
## docker-compose.yml
|
||||||
|
|
||||||
|
```
|
||||||
|
shadowsocks:
|
||||||
|
image: vimagick/shadowsocks-libev
|
||||||
|
environment:
|
||||||
|
- DNS_ADDR=8.8.8.8
|
||||||
|
- METHOD=chacha20
|
||||||
|
- PASSWORD=GUB61zGB2
|
||||||
|
net: container:iptables
|
||||||
|
restart: always
|
||||||
|
|
||||||
|
iptables:
|
||||||
|
image: vimagick/iptables
|
||||||
|
ports:
|
||||||
|
- "8388:8388"
|
||||||
|
environment:
|
||||||
|
- TCP_PORTS=80,443
|
||||||
|
- UDP_PORTS=53
|
||||||
|
- RATE=4mbit
|
||||||
|
- BURST=4mbit
|
||||||
|
cap_add:
|
||||||
|
- NET_ADMIN
|
||||||
|
restart: always
|
||||||
|
```
|
||||||
Reference in New Issue
Block a user