Unforgiven11
14.11.05, 20:09
Hallo!
Nach einigem Suchen habe ich im Netz ein Skript gefunden mit dem ich meinen Palm Pilot per ppp über TCP/IP mit dem Rechner verbinden kann. Das Skript hab ich von hier: http://atulchitnis.net/writings/palm-ppp.php und es sieht wie folgt aus:
#!/bin/sh
# Script to establish a routed and NAT'd ppp link between a Palm PDA
# and your PC.
# This script accompanies the article at
# http://atulchitnis.net/writings/palm-ppp.php
# By Atul Chitnis <http://atulchitnis.net>
# Version 1.1
# Note - if you are using a USB connection, start the connection
# at the Palm end *FIRST*, wait 2-3 seconds, then run this script.
# ---- start of parameter block
# The port your Palm is connected to
MyPort="/dev/ttyUSB1"
# The speed it talks at (ignored for USB connections)
MyBaud="115200"
# The IP address to assign to the Palm
MyPalmIP="192.168.99.2"
# The IP address to assign to PC's side of the link
MyPcIP="192.168.99.1"
# What DNS should the Palm use?
MyDNS=`grep ^nameserver /etc/resolv.conf|awk '{ print "ms-dns " $2 }'`
# Comment the previous line and uncomment and edit the next line if you
# prefer to use a DNS different from the ones in your /etc/resolv.conf
# MyDNS="192.168.1.1"
# What device will we use by default for the uplink?
MyUplink="eth0"
# Where are my tools?
MyTools="/sbin/"
# Where is pppd?
MyPPPD="/usr/sbin/pppd"
# ---- end of parameter block
# No edits should be required below
# Get rid of ipchains, if loaded
${MyTools}rmmod ipchains &> /dev/null
# Load iptables and some related modules
${MyTools}modprobe ip_tables
${MyTools}modprobe ip_conntrack_ftp
${MyTools}modprobe ip_conntrack_irc
# Flush any rules that may be hanging around
${MyTools}iptables -F
# OK, let's find out what our uplink device really is
DEFDEV=`${MyTools}route -n |grep "^0.0.0.0"|tr -s " "|cut -d " " -f8`
if [ ! -z "$DEFDEV" ]; then
MyUplink=$DEFDEV
fi
# All done, kick off pppd to talk to the port and establish a link
# pppd will wait for the actual connection to happen before going
# into the background
${MyPPPD} ${MyPort} ${MyBaud} local noauth \
${MyPcIP}:${MyPalmIP} $MyDNS passive updetach asyncmap 0
if [ ! -z "`${MyTools}ifconfig|grep ${MyPalmIP}`" ]; then
# OK, we have a link, let's NAT
echo 1 > /proc/sys/net/ipv4/ip_forward
${MyTools}iptables -A INPUT -i ! ${MyUplink} -j ACCEPT
${MyTools}iptables -A INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT
${MyTools}iptables -t nat -A POSTROUTING -o ${MyUplink} -j MASQUERADE
echo
echo -e Link is up, your Palm is at ${MyPalmIP} \\a
else
echo -e Link failed \\a
fi
Es klappt mit diesem Skript auf jeden Fall, dass der Palm eine IP bekommt und er läßt sich auch vom Rechner anpingen. Ich kann aber keine Verbindungen in die entgegengesetzte Richtung zustande bringen. Habe auf dem Palm ein Programm für ssh und eins für vnc, aber beide sagen, dass sie nicht connecten können.
Woran könnte das liegen? Muss ich an meiner Firewall noch was anderes einstellen? Habe hier Suse10 und benutze dessen Firewall. Kenne mich mit iptables auch so gut wie nicht aus.
Dazu dann auch noch eine Frage: Wie ist das Skript unter Sicherheitsaspekten zu bewerten? Ist das ok was drin steht?
Und dann die Zeile: MyUplink="eth0" Muss das die Netzwerkkarte sein über die ich ins Netz gehe, mit der dann auch der Palm rein kommen soll?
Wäre schön wenn mir einer hilft
Gruß
Martin
Nach einigem Suchen habe ich im Netz ein Skript gefunden mit dem ich meinen Palm Pilot per ppp über TCP/IP mit dem Rechner verbinden kann. Das Skript hab ich von hier: http://atulchitnis.net/writings/palm-ppp.php und es sieht wie folgt aus:
#!/bin/sh
# Script to establish a routed and NAT'd ppp link between a Palm PDA
# and your PC.
# This script accompanies the article at
# http://atulchitnis.net/writings/palm-ppp.php
# By Atul Chitnis <http://atulchitnis.net>
# Version 1.1
# Note - if you are using a USB connection, start the connection
# at the Palm end *FIRST*, wait 2-3 seconds, then run this script.
# ---- start of parameter block
# The port your Palm is connected to
MyPort="/dev/ttyUSB1"
# The speed it talks at (ignored for USB connections)
MyBaud="115200"
# The IP address to assign to the Palm
MyPalmIP="192.168.99.2"
# The IP address to assign to PC's side of the link
MyPcIP="192.168.99.1"
# What DNS should the Palm use?
MyDNS=`grep ^nameserver /etc/resolv.conf|awk '{ print "ms-dns " $2 }'`
# Comment the previous line and uncomment and edit the next line if you
# prefer to use a DNS different from the ones in your /etc/resolv.conf
# MyDNS="192.168.1.1"
# What device will we use by default for the uplink?
MyUplink="eth0"
# Where are my tools?
MyTools="/sbin/"
# Where is pppd?
MyPPPD="/usr/sbin/pppd"
# ---- end of parameter block
# No edits should be required below
# Get rid of ipchains, if loaded
${MyTools}rmmod ipchains &> /dev/null
# Load iptables and some related modules
${MyTools}modprobe ip_tables
${MyTools}modprobe ip_conntrack_ftp
${MyTools}modprobe ip_conntrack_irc
# Flush any rules that may be hanging around
${MyTools}iptables -F
# OK, let's find out what our uplink device really is
DEFDEV=`${MyTools}route -n |grep "^0.0.0.0"|tr -s " "|cut -d " " -f8`
if [ ! -z "$DEFDEV" ]; then
MyUplink=$DEFDEV
fi
# All done, kick off pppd to talk to the port and establish a link
# pppd will wait for the actual connection to happen before going
# into the background
${MyPPPD} ${MyPort} ${MyBaud} local noauth \
${MyPcIP}:${MyPalmIP} $MyDNS passive updetach asyncmap 0
if [ ! -z "`${MyTools}ifconfig|grep ${MyPalmIP}`" ]; then
# OK, we have a link, let's NAT
echo 1 > /proc/sys/net/ipv4/ip_forward
${MyTools}iptables -A INPUT -i ! ${MyUplink} -j ACCEPT
${MyTools}iptables -A INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT
${MyTools}iptables -t nat -A POSTROUTING -o ${MyUplink} -j MASQUERADE
echo
echo -e Link is up, your Palm is at ${MyPalmIP} \\a
else
echo -e Link failed \\a
fi
Es klappt mit diesem Skript auf jeden Fall, dass der Palm eine IP bekommt und er läßt sich auch vom Rechner anpingen. Ich kann aber keine Verbindungen in die entgegengesetzte Richtung zustande bringen. Habe auf dem Palm ein Programm für ssh und eins für vnc, aber beide sagen, dass sie nicht connecten können.
Woran könnte das liegen? Muss ich an meiner Firewall noch was anderes einstellen? Habe hier Suse10 und benutze dessen Firewall. Kenne mich mit iptables auch so gut wie nicht aus.
Dazu dann auch noch eine Frage: Wie ist das Skript unter Sicherheitsaspekten zu bewerten? Ist das ok was drin steht?
Und dann die Zeile: MyUplink="eth0" Muss das die Netzwerkkarte sein über die ich ins Netz gehe, mit der dann auch der Palm rein kommen soll?
Wäre schön wenn mir einer hilft
Gruß
Martin