[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[linux] iptables et netmeeting suite..
Bonjour la liste,
J'ai posté un message pour demander de l'aide pour configurer le
firewall-iptables permettant la communication entre les 2 clients
Netmeeting (et éventuellement Gnomemeeting) de chaque côté de celui-ci.
J'attache dans cet email le script trouvé tantôt sur google pour
demander vos conseils (peut marcher ou pas).
A propos des ports 1024-65535: est-ce nécessaire d'ouvrir tous ces ports
pour le client Netmeeting ? Quand même, il y a bcp de trous pour moi.
Sachant que GnomeMeeting n'a besoins que 2 ports (5000-5001).
Merci pour tous aides,
Truong,
--
---------------------------
Truong <tphuong@wol.be>
---------------------------
#!/bin/bash
#################################################
###### parameters on linux-firewall #######
#################################################
OUTSIDE_DEV=eth0
# if OUTSIDE_IP is not static
OUTSIDE_IP=""
# get OUTSIDE_IP if it's given by dhcp
if [ ${OUTSIDE_IP}x = "x" ]; then
OUTSIDE_IP=`/sbin/ifconfig $OUTSIDE_DEV | grep 'inet addr:' | \
awk '{print $2}' | sed -e 's/addr://'`
fi
INSIDE_DEV=eth1
INSIDE_IP=192.168.1.3
CLIENT_H323_IP=192.168.1.30
#################################################
echo "0" > /proc/sys/net/ipv4/ip_forward
iptables -P INPUT DROP
iptables -P OUTPUT DROP
iptables -P FORWARD DROP
iptables -t nat -A POSTROUTING -o ${OUTSIDE_DEV} -j MASQUERADE
#################################
### accept outbound connetion
#################################
### accept outbound for Internet_Locator_Server/LDAP (TCP/389)
iptables -A FORWARD -p tcp -d ${CLIENT_H323_IP} --dport 389 -o ${INSIDE_DEV} -j ACCEPT
### accept outbound for H.323 protocol (TCP/1720)
iptables -A FORWARD -p tcp -d ${CLIENT_H323_IP} --dport 1720 -o ${INSIDE_DEV} -j ACCEPT
#################################
### accept inbound connetion
#################################
# GM_PORTS="5000-5001" # GNOMEMEETING_DYNAMIC_PORTS
HIGH_PORTS="1024-65535" # NETMEETING_DYNAMIC_PORTS
# ---- TCP Port ----
TCP_Port="389 522 1503 1720 1731"
for port in $TCP_Port;do
iptables -t nat -A PREROUTING -p tcp -i $ --dport $TCP_Port \
-j DNAT --to $CLIENT_H323_IP:$TCP_Port
done
iptables -t nat -A PREROUTING -p tcp -d ${OUTSIDE_IP} --dport $HIGH_PORTS \
-j DNAT --to $CLIENT_H323_IP:$HIGH_PORTS
# ---- UDP Port ----
iptables -t nat -A PREROUTING -p udp -d ${OUTSIDE_IP} --dport $HIGH_PORTS \
-j DNAT --to $CLIENT_H323_IP:$HIGH_PORTS
### END H.323 ###
### others rules ... ###
echo 7 > /proc/sys/net/ipv4/ip_dynaddr
echo "1" > /proc/sys/net/ipv4/ip_forward
### EOF ###