From 72ce264ee73f8855972f576ca0889a980261aa32 Mon Sep 17 00:00:00 2001 From: Danilo Bargen Date: Tue, 17 May 2016 13:31:03 +0200 Subject: [PATCH 1/4] ufw: Add another example --- pages/linux/ufw.md | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/pages/linux/ufw.md b/pages/linux/ufw.md index 9eab6322a..2d96eded7 100644 --- a/pages/linux/ufw.md +++ b/pages/linux/ufw.md @@ -11,14 +11,18 @@ `ufw disable` +- Show ufw rules: + +`ufw status` + - Add ufw allow rule: `ufw allow {{port}} {{service_name}}` +- Example: Allow access to port 1337 from IP 1.2.3.4 using udp: + +`ufw allow from 1.2.3.4 to any port 1337 proto udp` + - Add ufw deny rule: `ufw deny {{port}} {{service_name}}` - -- Show ufw rules: - -`ufw status` From 7506047a39eb1e0250373670a7c0cf7fa8bf5dbb Mon Sep 17 00:00:00 2001 From: Agniva De Sarker Date: Sun, 28 Aug 2016 15:21:54 +0530 Subject: [PATCH 2/4] ufw: Improve page --- pages/linux/ufw.md | 24 ++++++++++++++++-------- 1 file changed, 16 insertions(+), 8 deletions(-) diff --git a/pages/linux/ufw.md b/pages/linux/ufw.md index 2d96eded7..a0f5bbb3b 100644 --- a/pages/linux/ufw.md +++ b/pages/linux/ufw.md @@ -11,18 +11,26 @@ `ufw disable` -- Show ufw rules: +- Show ufw rules, along with their numbers: -`ufw status` +`ufw status numbered` -- Add ufw allow rule: +- Allow incoming traffic on port 5432 on this host: -`ufw allow {{port}} {{service_name}}` +`ufw allow {{5432}}` -- Example: Allow access to port 1337 from IP 1.2.3.4 using udp: +- Allow only TCP traffic from 192.168.0.4 to any address on this host, on port 22: -`ufw allow from 1.2.3.4 to any port 1337 proto udp` +`ufw allow from {{192.168.0.4}} to {{any}} port {{22}} proto {{tcp}}` -- Add ufw deny rule: +- Deny traffic on port 80 on this host: -`ufw deny {{port}} {{service_name}}` +`ufw deny {{80}}` + +- Deny all UDP traffic to port 22: + +`ufw deny from {{any}} to {{any}} port {{22}} proto {{udp}}` + +- Remove a particular rule. The rule number can be retrieved from the `ufw status numbered` command: + +`ufw delete {{rule_number}}` From 964f07132be8b3bf445dcb527a5f89c00a45acfd Mon Sep 17 00:00:00 2001 From: Agniva De Sarker Date: Thu, 1 Sep 2016 10:50:48 +0530 Subject: [PATCH 3/4] Reordering the syntax to match with the description --- pages/linux/ufw.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pages/linux/ufw.md b/pages/linux/ufw.md index a0f5bbb3b..090ef7dce 100644 --- a/pages/linux/ufw.md +++ b/pages/linux/ufw.md @@ -21,7 +21,7 @@ - Allow only TCP traffic from 192.168.0.4 to any address on this host, on port 22: -`ufw allow from {{192.168.0.4}} to {{any}} port {{22}} proto {{tcp}}` +`ufw allow proto {{tcp}} from {{192.168.0.4}} to {{any}} port {{22}}` - Deny traffic on port 80 on this host: @@ -29,7 +29,7 @@ - Deny all UDP traffic to port 22: -`ufw deny from {{any}} to {{any}} port {{22}} proto {{udp}}` +`ufw deny proto {{udp}} from {{any}} to {{any}} port {{22}}` - Remove a particular rule. The rule number can be retrieved from the `ufw status numbered` command: From f08c58079bb0bc2b6ddce43aeb7c45464fa9bc28 Mon Sep 17 00:00:00 2001 From: Agniva De Sarker Date: Thu, 1 Sep 2016 16:02:55 +0530 Subject: [PATCH 4/4] Changing "Remove" to "Delete" --- pages/linux/ufw.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pages/linux/ufw.md b/pages/linux/ufw.md index 090ef7dce..e63b1fa05 100644 --- a/pages/linux/ufw.md +++ b/pages/linux/ufw.md @@ -31,6 +31,6 @@ `ufw deny proto {{udp}} from {{any}} to {{any}} port {{22}}` -- Remove a particular rule. The rule number can be retrieved from the `ufw status numbered` command: +- Delete a particular rule. The rule number can be retrieved from the `ufw status numbered` command: `ufw delete {{rule_number}}`