This repository was archived by the owner on Nov 10, 2023. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +12
-10
lines changed Expand file tree Collapse file tree 2 files changed +12
-10
lines changed Original file line number Diff line number Diff line change 55RUN go build -o /tracetrout -ldflags='-s -w'
66
77FROM alpine:3.7
8- RUN apk add --no-cache iptables libnetfilter_queue
8+ RUN apk add --no-cache iptables ip6tables libnetfilter_queue
99WORKDIR /tracetrout
1010COPY entrypoint.sh .
1111COPY --from=builder /tracetrout .
Original file line number Diff line number Diff line change 11set -e
22
3- iptables -A INPUT -t mangle -j CONNMARK --restore-mark
4- iptables -A INPUT -t mangle -m mark ! --mark 0 -j ACCEPT
5- iptables -A INPUT -t mangle -p tcp --dport " ${PORT} " -j MARK --set-mark 0x10000
6- iptables -A INPUT -t mangle -p tcp --dport " ${PORT} " -j MARK --or-mark " ${FILTER_QUEUE} "
7- iptables -A INPUT -t mangle -j CONNMARK --save-mark
8- iptables -A OUTPUT -t mangle -j CONNMARK --restore-mark
3+ for CMD in iptables ip6tables; do
4+ " ${CMD} " -A INPUT -t mangle -j CONNMARK --restore-mark
5+ " ${CMD} " -A INPUT -t mangle -m mark ! --mark 0 -j ACCEPT
6+ " ${CMD} " -A INPUT -t mangle -p tcp --dport " ${PORT} " -j MARK --set-mark 0x10000
7+ " ${CMD} " -A INPUT -t mangle -p tcp --dport " ${PORT} " -j MARK --or-mark " ${FILTER_QUEUE} "
8+ " ${CMD} " -A INPUT -t mangle -j CONNMARK --save-mark
9+ " ${CMD} " -A INPUT -m mark --mark 0x10000/0xffff0000 -m mark --mark " ${FILTER_QUEUE} /0xffff" -j NFQUEUE --queue-num " ${FILTER_QUEUE} "
910
10- iptables -A INPUT -m mark --mark 0x10000/0xffff0000 -m mark --mark " ${FILTER_QUEUE} /0xffff" -j NFQUEUE --queue-num " ${FILTER_QUEUE} "
11- iptables -A OUTPUT -m mark --mark 0x10000/0xffff0000 -m mark --mark " ${FILTER_QUEUE} /0xffff" -j NFQUEUE --queue-num " ${FILTER_QUEUE} "
11+ " ${CMD} " -A OUTPUT -t mangle -j CONNMARK --restore-mark
12+ " ${CMD} " -A OUTPUT -m mark --mark 0x10000/0xffff0000 -m mark --mark " ${FILTER_QUEUE} /0xffff" -j NFQUEUE --queue-num " ${FILTER_QUEUE} "
13+ done
1214
13- $@
15+ $@
You can’t perform that action at this time.
0 commit comments