با سلام خدمت دوستان،
نمونه iptable پیادهسازی شده برای بالا بردن امنیت سیستمهای ویپ که میتونید توی سیستمتون ازش استفاده کنید
فایل iptable-on
*filter
:INPUT ACCEPT
-A INPUT -s local network (sample 192.168.1.0/24) -j ACCEPT
-A INPUT -s IP Trunks (sample 185.98.113.0/24 = asiatech) -j ACCEPT
-A INPUT -p udp -m udp --dport 5060 -m string --string "User-Agent: Yealink" --algo bm --to 65535 -j ACCEPT
-A INPUT -p udp -m udp --dport 5060 -m string --string "User-Agent: MicroSIP" --algo bm --to 65535 -j ACCEPT
-A INPUT -p udp -m udp --dport 5060 -m string --string "MicroSIP" --algo bm --to 65535 -j ACCEPT
-A INPUT -p udp -m udp --dport 5060 -m string --string "SimoTel" --algo bm --to 65535 -j ACCEPT
-A INPUT -p udp -m udp --dport 5060 -m string --string "User-Agent: Simotel" --algo bm --to 65535 -j ACCEPT
-A INPUT -p udp -m udp --dport 5060 -m string --string "User-Agent: SimoTel" --algo bm --to 65535 -j ACCEPT
-A INPUT -p udp -m udp --dport 5060 -m string --string "Server: SimoTel" --algo bm --to 65535 -j ACCEPT
-A INPUT -p udp -m udp --dport 5060 -m conntrack --ctstate NEW -m string --string "User-Agent: SimoTel" --algo bm --to 65535 -j ACCEPT
-A INPUT -p udp -m udp --dport 5060 -m conntrack --ctstate NEW -m string --string "Server: SimoTel" --algo bm --to 65535 -j ACCEPT
-A INPUT -p udp -m udp --dport 5060 -m string --string "User-Agent: Zoiper" --algo bm --to 65535 -j ACCEPT
-A INPUT -p udp -m udp --dport 5060 -m string --string "User-agent: eyeBeam" --algo bm --to 65535 -j ACCEPT
-A INPUT -p udp -m udp --dport 5060 -m string --string "User-Agent: Z" --algo bm --to 65535 -j ACCEPT
-A INPUT -p udp -m udp --dport 5060 -m string --string "User-Agent: Grandstream" --algo bm --to 65535 -j ACCEPT
-A INPUT -p udp -m udp --dport 5060 -m string --string "User-Agent: Htek" --algo bm --to 65535 -j ACCEPT
-A INPUT -p udp -m udp --dport 5060 -m string --string "User-Agent: Akuvox" --algo bm --to 65535 -j ACCEPT
-A INPUT -s 0.0.0.0/0 -p udp --dport 5060 -j DROP
-A INPUT -s ip gateway (sample:192.168.1.1) -p udp --dport 5060 -j DROP
COMMIT
پس از ایجاد فایل و ذخیره آن میتوانید با دستور iptable-restore فایل مربوطه را فعال کنید،برای مثال
iptable-restore /etc/iptable-on
فایل iptable-off
*filter
:INPUT ACCEPT
:FORWARD ACCEPT
:OUTPUT ACCEPT
COMMIT
برای غیرفعال سازی نیز از دستور iptable-restore استفاده کنید،برای نمونه
iptable-restore /etc/iptable-off
در نظر داشته باشید که هدف از راهاندازی این فایروال بالا بردن امنیت سیستم میباشد و برای جلوگیری کامل از حملات ویپ نیاز میباشد از فایروالهای مخصوص ویپ(SBC) استفاده نمایید.