Set ubuntu firewall script corporate environment

ubuntu firewall settings

Directly to the initial state,
try not to try reloading iptables and ufw, a firewall can easily lead to collapse out, finally may only reinstall the system.

Placed Screenplay
firewall.sh 

# / bin / bash 

ufw disable 
echo the y-| // reset the RESET ufw ufw 


ufw the allow from this ip xxx.xxx.xxx.xxx open all ports // 

ufw from xx.xxx.xx.0 the allow / 24- // ip of certain open all ports 
from the allow 192.168.101.0/24 ufw 
ufw from xx.xx.xx.xx to the allow the any proto udp port 161 is open to a // ip 161 / udp port 
echo the y-| ufw enable 

# the WEB service allow // open a public network without tcp port tcp and udp on behalf of full 
ufw the allow 80 / tcp 

ufw the allow 1: 500 / tcp // batch open to the public network port 1-500 


# default limit all the default Rules // 
ufw default deny incoming

Guess you like

Origin www.cnblogs.com/linuxprobe-sarah/p/10958359.html