Thứ bảy, 19 Tháng 5 2012 16:07

Tường lửa cho Linux Server bằng IPTABLES!

1. Giới thiệu:

Trang này sẽ mô tả cách tôi thiết lập các đoạn Script để Firewall bằng iptables dựa trên kernel 2.4 hoặc 2.6. Phần này sẽ không chi tiết và cũng không dạy cho bạn bất cứ gì về ipatbles, ở đây là những đoạn scripts mà bạn có thể dùng, những thứ mà tôi biết và thực hiện trên các server của tôi. Những scripts này là những gì tôi thường dùng khi cài đặt, thiết lập hệ thống bảo vệ cho các máy chủ server của tôi bấy lâu nay, cơ bản là rất hiệu quả.

2. Scripts:

Tôi có đoạn scripts khác nhau để initiate/deactivate dịch vụ firewall cho máy chủ Linux

Tập tin script "pre.iptable" sẽ từ chối mọi thứ đi vào máy chủ từ môi trường Internet. 

The Scripts

I use 3 different scripts to initiate/deactivate the firewall services for Linux.

A pre.iptable script that will deny everything that comes in on the Internet. I initiate this before any network interfaces come up so when the network comes up it is protected in case, for any reason, the main firewall script fails to initialize.

A rc.firewall script as the main script to initiate all the firewall and masquerading services needed to run on the network. Basically what this script will do is allow anyone on the internal network to access all the services of the internet, but anyone from the outside cannot access the internal network, unless someone on the internal network initiates the communication.

Finally a script to flush all the IPTables at shutdown, or whenever you make changes to the main script.

In order for IPTables to work properly, you must have all the required Kernel modules available, they are listed in the main rc.iptables script. Most Linux Distributions will already provide these within their default kernels.

eduapps for u

school

 

Lượt truy cập

mod_vvisit_countermod_vvisit_countermod_vvisit_countermod_vvisit_countermod_vvisit_countermod_vvisit_countermod_vvisit_counter
mod_vvisit_counterHôm nay203
mod_vvisit_counterHôm qua354
mod_vvisit_counterTuần này1855
mod_vvisit_counterTháng này5217
mod_vvisit_counterTổng cộng164706