Crmgo Blog

iptables Rules (office)

iptables Rules (office)

*nat :PREROUTING ACCEPT [0:0] #:INPUT DROP [2428:279459] :OUTPUT ACCEPT [0:0] :POSTROUTING ACCEPT [0:0] -A PREROUTING -s 192.168.4.0/24 ! -d 192.168.4.0/24 -p tcp -m tcp --dport 80 -j REDIRECT --to-ports 7777 -A POSTROUTING -s 192.168.4.0/24 -j MASQUERADE COMMIT # Completed on…

iptables Rules (office)

*nat
:PREROUTING ACCEPT [0:0]
#:INPUT DROP [2428:279459]
:OUTPUT ACCEPT [0:0]
:POSTROUTING ACCEPT [0:0]

-A PREROUTING -s 192.168.4.0/24 ! -d 192.168.4.0/24 -p tcp -m tcp --dport 80 -j REDIRECT --to-ports 7777
-A POSTROUTING -s 192.168.4.0/24 -j MASQUERADE
COMMIT
# Completed on Thu Dec 1 08:52:15 2011
# Generated by iptables-save v1.4.12 on Thu Dec 1 08:52:15 2011
*filter
:INPUT DROP [0:0]
:FORWARD ACCEPT [0:0]
:OUTPUT ACCEPT [1002:219010]
:VOIP_SAFE_HOSTS - [0:0]
#friend hosts with inet
-A INPUT -i eth0 -j ACCEPT
-A INPUT -i lo -j ACCEPT
-A INPUT -m state --state RELATED,ESTABLISHED -j ACCEPT
# IAX2 - IAX protocol
-A INPUT -p udp -m udp --dport 4569 -j ACCEPT
-A INPUT -p tcp -m tcp --dport 80 -j ACCEPT
# # IAX - most of them have moved to IAX v2, or should
-A INPUT -p udp -m udp --dport 5036 -j ACCEPT
-A INPUT -p udp -m udp --dport 10000:20000 -j ACCEPT
-A INPUT -p tcp -m tcp --dport 22 -j VOIP_SAFE_HOSTS
-A INPUT -p udp -m udp --dport 5060 -j VOIP_SAFE_HOSTS
-A INPUT -p tcp -m tcp --dport 21 -j VOIP_SAFE_HOSTS
-A INPUT -p tcp -m tcp --dport 20 -j VOIP_SAFE_HOSTS
-A INPUT -p tcp -m tcp --dport 3306 -j VOIP_SAFE_HOSTS
-A INPUT -p tcp -m tcp --dport 7777 -j VOIP_SAFE_HOSTS
-A INPUT -s ip to which everything is allowed -j ACCEPT

#-A INPUT ! -s 192.168.4.0/24 -p udp -m udp --dport 5060 -j DROP
#-A VOIP_SAFE_HOSTS -s 192.168.4.0/24 -j ACCEPT
-A VOIP_SAFE_HOSTS -s xx.xx.xx.xx/32 -j ACCEPT

-A VOIP_SAFE_HOSTS -m iprange --src-range 213.108.75.91-213.108.75.95 -j ACCEPT

Note: This post may be AI-assisted and then human-edited. Editorial responsibility: Dmytro Lomaka, Kaltenkirchen.

Categories: FAQ