I am trying to configure iptables on Ubuntu. I have the server setup as a transparent proxy using Squid which is working fine. At this time only port 80 is redirected to SQUID via nat iptables. I basically want to allow 80, 443, VOIP (SIP) and email protocols and block everything else. currently i have the following.
sudo iptables -A FORWARD -j ACCEPT -p tcp --dport https
sudo iptables -A FORWARD -j ACCEPT -p tcp --dport pop3
sudo iptables -A FORWARD -j ACCEPT -p tcp --dport imaps
sudo iptables -A FORWARD -j ACCEPT -p tcp --dport imap2
sudo iptables -A FORWARD -j ACCEPT -p tcp --dport smtp
sudo iptables -A FORWARD -j ACCEPT -p udp --dport sip
sudo iptables -A FORWARD -j ACCEPT -p udp --dport 10000:20000
sudo iptables -FORWARD -j REJECT -p tcp
sudo iptables -FORWARD -j REJECT -p udp
Few issues with this config:
- for some strange reason Gmail doesn't work over https. Does it use other ports in the background or am I overlooking something?
- I cannot seem to find the port range of the VOIP system we are using. System is from Tachyon and is SIP based. With the current config the phone rings but once answered there is nothing there which leads me to believe that the port range i put in was incorrect. udp 10000:20000 is the RTP protocol but not the one used in this scenario. What are the other protocols usually associated with SIP or is every implementation different.
Gracias!