Thứ Ba, 22 tháng 7, 2014

BLOCKING IP EX4200,EX2200



XỬ LÝ CASE : BLOCKING IP EX4200,EX2200


Thực hiện: Firewall filter trên Switch EX4200, EX2200.

Bước 1: CẤU HÌNH PREFIX_LIST: Trong này sẽ chưa list IP cần chặn:

Edit policy-option
Set prefix-list block.dos
Edit prefix-list block.dos
Set 115.142.121.72/32
Set IP/SM
Set IP/SM

Bước 2: Thiết lập firewall filter (inet):
Thực hiện lệnh:
Set firewall family inet filter deny-IP term 1 from prefix-list block.dos
Set firewall family inet filter deny-IP term 1 then discard
// Ngoài việc chặn source, ta có thể cấu hình thêm để chặn destination của kết nối:
Set firewall family inet filter deny-IP term 1 from destination-address
{
IP đích của kết nối (IP server).
}
// Chặn thêm port , giả sử chặn kết nối TCP, port 80.

Set firewall family inet filter deny-IP term 1 from protocol tcp
Set firewall family inet filter deny-IP term 1 from protocol destination-port 80;

//Cho phep cac kết nối từ Dãy IP khác. Lưu ý nếu không thực hiện lệnh này thì mặc định các IP khác cũng sẽ bị chặn hết.

Set firewall family inet filter deny-IP term  2 then accept  


Bước 2: Gán filter vào cổng ae0:

Set interfaces ae0 unit 0 family inet filter input deny-IP
 
A.      VÍ DỤ MINH HỌA:
 
Ví dụ chặn dãy IP :
69.93.94.154/32;

109.233.112.63/32;

183.61.241.31/32;

186.2.164.89/32;

60.214.139.197/32;

122.224.32.238/32;
Kết nối đến server 200.2.2.0/24 port 80
 
Thực hiện cấu hình như sau:
 
Edit policy-option prefix-list block.dos 
Set 69.93.94.154/32
Set 109.233.112.63/32
Set 183.61.241.31/32
Set 186.2.164.89/32
Set 60.214.139.197/32
Set 122.224.32.238/32
Set firewall family inet filter deny-IP term 1 from prefix-list block.dos
Set firewall family inet filter deny-IP term 1 then discard
Set firewall family inet filter deny-IP term 1 from destination-address
200.2.2.0/24
Set firewall family inet filter deny-IP term 1 from protocol destination-port 80
Set firewall family inet filter deny-IP term  2 then accept  

Set interfaces ae0 unit 0 family inet filter input deny-IP