From b6f325f9d1cc6ba0fac14333e879be55eaba3767 Mon Sep 17 00:00:00 2001 From: Chai Feng Date: Wed, 8 Aug 2018 23:03:01 +0800 Subject: [PATCH] forgot to add ufw-user-forward table --- README.md | 2 ++ ufw-docker | 7 ++++--- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index bbdea2c..0d81c7a 100644 --- a/README.md +++ b/README.md @@ -66,6 +66,7 @@ Modify the UFW configuration file `/etc/ufw/after.rules` and add the following r # BEGIN UFW AND DOCKER *filter + :ufw-user-forward - [0:0] :DOCKER-USER - [0:0] -A DOCKER-USER -j RETURN -s 10.0.0.0/8 -A DOCKER-USER -j RETURN -s 172.16.0.0/12 @@ -189,6 +190,7 @@ UFW 是 Ubuntu 上很流行的一个 iptables 前端,可以非常方便的管 # BEGIN UFW AND DOCKER *filter + :ufw-user-forward - [0:0] :DOCKER-USER - [0:0] -A DOCKER-USER -j RETURN -s 10.0.0.0/8 -A DOCKER-USER -j RETURN -s 172.16.0.0/12 diff --git a/ufw-docker b/ufw-docker index 1c4ef06..22e69c8 100755 --- a/ufw-docker +++ b/ufw-docker @@ -98,12 +98,13 @@ function ufw-docker--instance-name() { function ufw-docker--install() { if ! grep "^# BEGIN UFW AND DOCKER\$" /etc/ufw/after.rules &>/dev/null; then - err "Back up /etc/ufw/after.rules" + err "Back up /etc/ufw/after.rules" cp /etc/ufw/after.rules /etc/ufw/after.rules-ufw-docker~"$(date '+%Y-%m-%d-%H%M%S').bak" cat <<-\EOF | tee -a /etc/ufw/after.rules # BEGIN UFW AND DOCKER *filter :DOCKER-USER - [0:0] + :ufw-user-forward - [0:0] -A DOCKER-USER -j RETURN -s 10.0.0.0/8 -A DOCKER-USER -j RETURN -s 172.16.0.0/12 -A DOCKER-USER -j RETURN -s 192.168.0.0/16 @@ -121,8 +122,8 @@ function ufw-docker--install() { COMMIT # END UFW AND DOCKER EOF - err "Please restart UFW service manually." - fi + err "Please restart UFW service manually." + fi } function ufw-docker--help() {