Mình xin trả lời bạn như sau:
Đầu tiên bạn phải kiểm tra xem có bản Iptables nào cho cái container đó ko. Bật vi lên chỉnh lại /etc/sysconfig/iptables-config và/etc/sysconfig/vz trên hardware node. Thêm module bạn cần vào 2 dòng "IPTABLES_MODULES=" và "IPTABLES=". Bạn phải lưu ý là tất cả các iptables module trong /etc/sysconfig/vz trong tham số IPTABLES phải được liệt kê trên 1 dòng.
Ví dụ, cấu hình 1 phiên bản firewall chuẩn cần những module sau:
Edit /etc/sysconfig/iptables-config file:
Code:
IPTABLES_MODULES="ipt_REJECT ipt_tos ipt_TOS ipt_LOG ip_conntrack ipt_limit ipt_multiport iptable_filter iptable_mangle ipt_TCPMSS ipt_tcpmss ipt_ttl ipt_length ipt_state iptable_nat ip_nat_ftp"
Edit /etc/sysconfig/vz file:
Code:
IPTABLES="ipt_REJECT
ipt_tos ipt_TOS ipt_LOG ip_conntrack ipt_limit ipt_multiport iptable_filter iptable_mangle ipt_TCPMSS ipt_tcpmss ipt_ttl ipt_length ipt_state iptable_nat ip_nat_ftp"
Thay đổi sẽ có hiệu lực sau khi bạn đã tải xong các module trên và restart Virtuzzo service (Tất cả các VPS sẽ cùng bị restart)
Code:
# service vz stop
# service iptables restart
# service vz start
Những module bạn chọn sẽ có hiệu lực với tất cả các VPS. Tuy nhiên, bạn có thể lập danh sách module cho mỗi VPS sử dụng tính năng --iptables của vzctl. Ví dụ:
Code:
vzctl set 101 --iptables ipt_REJECT --iptables ipt_tos --iptables ipt_TOS --iptables ipt_LOG --iptables ip_conntrack --iptables ipt_limit --iptables ipt_multiport --iptables iptable_filter --iptables iptable_mangle --iptables ipt_TCPMSS --iptables ipt_tcpmss --iptables ipt_ttl --iptables ipt_length --iptables ipt_state --iptables iptable_nat --iptables ip_nat_ftp --save
Bạn sẽ cần gia tăng độ bảo mật cho giá trị numiptent trong proc/user_beancounters sử dụng vzctl. Giá trị này có tác dụng giới hạn số iptables rules mà chủ VPS cho phép tạo. VÍ dụ, đây là cách bạn cho phép 400 rules được tạo trên Container 101:
Code:
# vzctl set 101 --numiptent 400 --save