PPTP

Här ställer ni allmäna frågor kring Slackware Linux

Moderatorer: Nille, nomicon, Minime

Plutonium
Allsmäktig
Inlägg: 226
Blev medlem: 14 apr 2005 05:36
ORT: Essunga

PPTP

Inlägg av Plutonium »

Hej.
Jag har lite (vad jag tror är) konfigrations problem för att få igång min PPTP VPN.
Jag har en slackware 13 burk som routrar mitt nät, och ser ut så på följande:

<internet> --- [[eth0]Slackware 13[eth2] 10.0.20.1] --- <Lan 10.0.20.*>

Jag tog ner pptp genom slackbuilds.org och fick "igång" det utan några felmeddelanden. Så allt vådar ju gott där.
Vad jag tror är att min brandvägg sätter käppar i hjulet för mig. Har läst lite överallt på nätet och har inte funnit så mkt information hur folk har löst det med den setup'en som jag har.
Hoppas någon här har lite mer kunskap. Har aldrig grejar med VPN förrut, skulle vara kul att få det att fungera.

Min brandvägg ser ut så här och längst ner är PPTP sektionen:

Kod: Markera allt

#!/bin/sh

#### Nätverks kort ####
INET_IFACE="eth0"
LAN_IFACE="eth2"

#### Laddar moduler ####
modprobe ip_conntrack_ftp > /dev/null
modprobe ip_nat_ftp > /dev/null
modprobe ip_conntrack > /dev/null
modprobe ipt_REDIRECT > /dev/null
modprobe ipt_MASQUERADE > /dev/null
modprobe ip_conntrack_pptp
modprobe ip_nat_pptp

#### Ta bort alla kejdor & regler ####
iptables -F
iptables -F INPUT
iptables -F FORWARD
iptables -F OUTPUT
iptables -X
iptables -Z
iptables -t nat -F

#### Stoppar ALL trafik ####
iptables -P INPUT DROP
iptables -P OUTPUT DROP

#### Logga trafik ####
iptables -N logdrop
iptables -A logdrop -j LOG
iptables -A logdrop -j DROP

#### Accepterar Output & Routring ####
iptables -P OUTPUT ACCEPT
iptables -t nat -A POSTROUTING -o $INET_IFACE -j MASQUERADE

#### Tillåter forwarding och accepterar att LAN att gå genom internet kortet ####
iptables -A FORWARD -i $LAN_IFACE -j ACCEPT
iptables -A FORWARD -i $LAN_IFACE -o $INET_IFACE -m state --state NEW,ESTABLISHED -j ACCEPT

#### Accepterar att datorerna inom nätverket får tillgång till routern ####
iptables -A INPUT -i $LAN_IFACE -j ACCEPT
iptables -A OUTPUT -o $LAN_IFACE -j ACCEPT

#### Accepterar packet som har skickats ut komma in igen ####
iptables -A INPUT -i $INET_IFACE -m state --state ESTABLISHED,RELATED -j ACCEPT
iptables -A INPUT -i $LAN_IFACE -m state --state ESTABLISHED,RELATED -j ACCEPT

#### Tillåter att pinga till & från localhost ####
iptables -A OUTPUT -o $INET_IFACE -p icmp -m state --state NEW -j ACCEPT
iptables -A INPUT -p icmp -m state --state ESTABLISHED,RELATED -j ACCEPT

#### Acceptera att prata med sig själv ####
iptables -A INPUT -i lo -j ACCEPT
iptables -A OUTPUT -o lo -j ACCEPT

#### PPTP ####
vpnserver="10.0.20.1"
iptables -N pptp
iptables -A pptp -p tcp --destination-port 1723 --dst $vpnserver -j ACCEPT
iptables -A pptp -p 47 --dst $vpnserver -j ACCEPT
iptables -I FORWARD -j pptp
iptables -t nat -N pptp
iptables -t nat -A pptp -i $INET_IFACE -p tcp --dport 1723 -j DNAT --to $vpnserver:1723
iptables -t nat -A pptp -i $INET_IFACE -p 47 -j DNAT --to $vpnserver
iptables -t nat -A PREROUTING -j pptp

Här är pptpd.conf, vet faktiskt inte riktigt vad man behöver göra i denna :oops:

Kod: Markera allt

###############################################################################
# $Id: pptpd.conf,v 1.10 2006/09/04 23:30:57 quozl Exp $
# 
# Sample Poptop configuration file /etc/pptpd.conf
#       
# Changes are effective when pptpd is restarted.
###############################################################################

# TAG: ppp
#       Path to the pppd program, default '/usr/sbin/pppd' on Linux
#
#ppp /usr/sbin/pppd
 
# TAG: option 
#       Specifies the location of the PPP options file.
#       By default PPP looks in '/etc/ppp/options'
#
option /etc/ppp/options.pptpd

# TAG: debug
#       Turns on (more) debugging to syslog
#
#debug

# TAG: stimeout
#       Specifies timeout (in seconds) on starting ctrl connection
#       
#stimeout 10

# TAG: noipparam
#       Suppress the passing of the client's IP address to PPP, which is
#       done by default otherwise.
#
#noipparam

# TAG: logwtmp
#       Use wtmp(5) to record client connections and disconnections.
#       
logwtmp

# TAG: bcrelay <if>
#       Turns on broadcast relay to clients from interface <if>
# 
#bcrelay eth1

# TAG: delegate
#       Delegates the allocation of client IP addresses to pppd.
#       
#       Without this option, which is the default, pptpd manages the list of
#       IP addresses for clients and passes the next free address to pppd.
#       With this option, pptpd does not pass an address, and so pppd may use
#       radius or chap-secrets to allocate an address.
#
delegate
  
# TAG: connections
#       Limits the number of client connections that may be accepted.
#       
#       If pptpd is allocating IP addresses (e.g. delegate is not
#       used) then the number of connections is also limited by the
#       remoteip option.  The default is 100.
connections 100

# TAG: localip
# TAG: remoteip
#       Specifies the local and remote IP address ranges.
#          
#       These options are ignored if delegate option is set.
# 
#       Any addresses work as long as the local machine takes care of the
#       routing.  But if you want to use MS-Windows networking, you should
#       use IP addresses out of the LAN address space and use the proxyarp
#       option in the pppd options file, or run bcrelay.
#
#
#       You can specify single IP addresses seperated by commas or you can
#       specify ranges, or both. For example:
#
#               192.168.0.234,192.168.0.245-249,192.168.0.254
#
#       IMPORTANT RESTRICTIONS:
#
#       1. No spaces are permitted between commas or within addresses.
#
#       2. If you give more IP addresses than the value of connections,
#          it will start at the beginning of the list and go until it
#          gets connections IPs.  Others will be ignored.
#
#       3. No shortcuts in ranges! ie. 234-8 does not mean 234 to 238,
#          you must type 234-238 if you mean this.
#
#       4. If you give a single localIP, that's ok - all local IPs will
#          be set to the given one. You MUST still give at least one remote
#          IP for each simultaneous client.
#
# (Recommended)
#localip 10.0.20.1
#remoteip 192.168.0.234-238,192.168.0.245
# or
#localip 192.168.0.234-238,192.168.0.245
#remoteip 192.168.1.234-238,192.168.1.245
Tack på förhand!
maup
Lärling
Inlägg: 52
Blev medlem: 17 jun 2009 14:52

Re: PPTP

Inlägg av maup »

Här är några länkar som kanske kan vara till hjälp:

http://home.gna.org/kvpnc/en/index.html

http://ubuntuforums.org/showthread.php?t=994185

Förövrigt borde du väl se i loggarna om brandväggen stoppar pptp?

/Magnus
Plutonium
Allsmäktig
Inlägg: 226
Blev medlem: 14 apr 2005 05:36
ORT: Essunga

Re: PPTP

Inlägg av Plutonium »

Tackar maup.
Med friska krafter ser jag i loggen att brandväggen droppar all trafik som har med pptp att göra. Men ändå ser det ut som att han vill skicka det till rätt destination (10.0.20.1). :?:

Kod: Markera allt

Apr 30 08:46:51 firewall kernel: dropped packetIN=eth0 OUT= MAC=00:0c:29:d3:0c:fe:00:04:96:14:b9:30:08:00 SRC=90.238.197.* DST=10.0.20.1 LEN=48 TOS=0x00 PREC=0x00 TTL=50 ID=46805 DF PROTO=TCP SPT=52400 DPT=1723 WINDOW=65535 RES=0x00 SYN URGP=0
maup
Lärling
Inlägg: 52
Blev medlem: 17 jun 2009 14:52

Re: PPTP

Inlägg av maup »

Det ser ut som att NAT'en inte fungerar riktigt.

Nedanstående länk kanske kan hjälpa:

http://lists.netfilter.org/pipermail/ne ... 61212.html

/Magnus