Tach auch,
ich habe ein kleines Problem. Ich soll zu einem Kunden eine VPN-Verbindung aufbauen.
Der Kunde hat sein eigenes privates Netzwerk (192.168.0.) und ich habe hier in der
Firma mein eigenes Firmennetzwerk (192.168.1)
Ich habe die vom Kunden die ext. IP-Adresse vom VPN-Server.
Meinen MD 9.1 Server habe ich mit iptables konfiguriert Er dient als Router unf Firewall.
Wenn ich jetzt von meinem lokalen Windows-PC (192.168.1.12) eine VPN Verbindung zum VPN-Server
des Kundenaufbaue klappt das auch fast. Ich habe Portforwarding bei mir eingerichtet, damit
der Novell Boardermanager 3.7 richtig angesprochen werden kann.
Jedoch bekommt der VPN-Server wegen der Port-Weiterleitung nicht mehr meine ext. IP-Adresse vom
ppp0-Device übermittelt sondern nur noch die lokale IP-Adresse von meinem Windows-PC.
(192.168.1.12) Und das mag der VPN-Server nicht <img src="http://www.pl-forum.de/UltraBoard/Images/Sad.gif" border="0" align="middle">
Wie kann ich jetzt die Pakete die von meinem Windows-PC kommen mit der IP-Adresse von meiner
ppp0-Schnittstelle ausstatten ???
Vielen Dank schon mal,
Rainer
Mein Firewall-Skript sieht wie folgt aus:
#!/bin/sh
# --------( Initial Setup - Network Information (required) )--------
IF=ppp0
INIF=eth0
IP=`/sbin/ifconfig $IF | grep inet | cut -d : -f 2 | cut -d \ -f 1`
MASK=`/sbin/ifconfig $IF | grep Mas | cut -d : -f 4`
NET=$IP/$MASK
INMASK="user specified in INNET"
INNET=192.168.1.0/24
if [ "$MASK" = "" ]; then
echo "External network device $IF is not ready. Aborting.."
exit 2
fi
if [ "$INMASK" = "" ]; then
echo "Internal network device $INIF is not ready. Aborting.."
exit 3
fi
# --------( Initial Setup - Firewall Location Check )--------
IPT=/sbin/iptables
MPB=/sbin/modprobe
LSM=/sbin/lsmod
RMM=/sbin/rmmod
# --------( Initial Setup - Firewall Modules Check )--------
# Some distributions still load ipchains
$LSM | grep ipchains -q -s && $RMM ipchains
# --------( Initial Setup - Firewall Modules Autoloader )--------
if ! ( $LSM | /bin/grep ip_conntrack > /dev/null ); then
$MPB ip_conntrack
fi
if ! ( $LSM | /bin/grep ip_conntrack_ftp > /dev/null ); then
$MPB ip_conntrack_ftp
fi
if ! ( $LSM | /bin/grep ip_conntrack_irc > /dev/null ); then
$MPB ip_conntrack_irc
fi
if ! ( $LSM | /bin/grep ipt_REJECT > /dev/null ); then
$MPB ipt_REJECT
fi
if ! ( $LSM | /bin/grep ipt_REDIRECT > /dev/null ); then
$MPB ipt_REDIRECT
fi
if ! ( $LSM | /bin/grep ipt_TOS > /dev/null ); then
$MPB ipt_TOS
fi
if ! ( $LSM | /bin/grep ipt_MASQUERADE > /dev/null ); then
$MPB ipt_MASQUERADE
fi
if ! ( $LSM | /bin/grep ipt_LOG > /dev/null ); then
$MPB ipt_LOG
fi
if ! ( $LSM | /bin/grep iptable_mangle > /dev/null ); then
$MPB iptable_mangle
fi
if ! ( $LSM | /bin/grep iptable_nat > /dev/null ); then
$MPB iptable_nat
fi
# --------( Initial Setup - Additional Firewall Modules (PPP) )--------
if ! ( $LSM | /bin/grep bsd_comp > /dev/null ); then
$MPB bsd_comp
fi
if ! ( $LSM | /bin/grep _deflate > /dev/null ); then
$MPB ppp_deflate
fi
# --------( Chain Configuration - Flush Existing Chains )--------
# Delete user made chains. Flush and zero the chains.
$IPT -F
$IPT -X
$IPT -Z
# --------( Chain Configuration - Delete Extinct Chains )--------
# Delete `nat' and `mangle' chains.
if ( $LSM | /bin/grep iptable_mangle > /dev/null ); then
$IPT -t mangle -F
fi
if ( $LSM | /bin/grep iptable_nat > /dev/null ); then
$IPT -t nat -F
fi
# --------( Masquerading aktivieren )--------
$IPT -t nat -A POSTROUTING -o $IF -j MASQUERADE
# IP-Forwarding atkivieren
echo 1 > /proc/sys/net/ipv4/ip_forward
# ***************************************************************
# **** Z U L A S S E N ****
# ***************************************************************
# Zugaenge zum Server
# SSH-Zugang aktivieren
$IPT -A INPUT -p tcp --destination-port ssh -i ppp0 -j ACCEPT
# FTP-Zugang aktivieren
$IPT -A INPUT -p tcp --destination-port ftp -i ppp0 -j ACCEPT
$IPT -A INPUT -p udp --destination-port ftp -i ppp0 -j ACCEPT
$IPT -A INPUT -p tcp --destination-port ftp-data -i ppp0 -j ACCEPT
$IPT -A INPUT -p udp --destination-port ftp-data -i ppp0 -j ACCEPT
# HTTP(s)-Zugang aktivieren
$IPT -A INPUT -p tcp --destination-port http -i ppp0 -j ACCEPT
$IPT -A INPUT -p udp --destination-port http -i ppp0 -j ACCEPT
$IPT -A INPUT -p tcp --destination-port https -i ppp0 -j ACCEPT
$IPT -A INPUT -p udp --destination-port https -i ppp0 -j ACCEPT
# ***************************************************************
# **** W E I T E R L E I T E N ****
# ***************************************************************
# VPN-BorderManager-Zugang aktivieren
$IPT -t nat -A PREROUTING -p tcp --dport 213 -j DNAT --to-destination 192.168.1.12
$IPT -t nat -A PREROUTING -p tcp --dport 353 -j DNAT --to-destination 192.168.1.12
$IPT -t nat -A PREROUTING -p udp --dport 353 -j DNAT --to-destination 192.168.1.12
$IPT -t nat -A PREROUTING -p tcp --dport 2010 -j DNAT --to-destination 192.168.1.12
# ***************************************************************
# **** B L O C K E N ****
# ***************************************************************
# Kette erstellen, die neue Verbindungen blockt, es sei denn, sie kommen
# von innen
$IPT -N block
$IPT -A block -m state --state ESTABLISHED,RELATED -j ACCEPT
$IPT -A block -m state --state NEW -i ! ppp0 -j ACCEPT
$IPT -A block -j DROP
# Von INPUT und FORWARD zu dieser Kette springen
$IPT -A INPUT -j block
$IPT -A FORWARD -j block