Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Using script to set up ubuntu Firewall in Enterprise Environment

2025-04-02 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/02 Report--

Ubuntu Firewall Settings

You can set it directly in the initial state.

Try not to reinstall iptables and ufw, which can easily lead to a firewall collapse and may end up having to reinstall the system.

Configuration script firewall.sh#/bin/bashufw disableecho y | ufw reset / / reset ufwufw allow from xxx.xxx.xxx.xxx / / Open all ports to this ip ufw allow from xx.xxx.xx.0/24 / / Open all ports to a certain segment of ip ufw allow from 192.168.101.0/24ufw allow from xx.xx.xx.xx to any port 161proto udp / / Open 161/udp ports to a certain ip echo y | ufw enable# WEB service allow / / A pair of public networks open a port without tcp means tcp and udp are fully open ufw allow 80/tcpufw allow 1:500/tcp / / A pair of public network batch open ports 1-50 Default Rules / / default limits all ufw default deny incoming

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report