Hurricane Electric's IPv6 Tunnel Broker Forums

Advanced search  

News:

Welcome to Hurricane Electric's Tunnelbroker.net forums!

Author Topic: HowTo: Create 6in4 Tunnel with PPTP in Ubuntu  (Read 7021 times)

bearice

  • Newbie
  • *
  • Posts: 7
HowTo: Create 6in4 Tunnel with PPTP in Ubuntu
« on: June 23, 2010, 10:52:13 AM »

all following commands assumes you are root.
1.create the PPTP tunnel
Quote
pptpsetup --create IPv6VPN --server tserv3.fmt2.ipv6.he.net  --username bearice%63106 --password ***
then you wil be able to connect the pptp using "pon IPv6VPN", but it could not reconnect if connection is dropped.
change file /etc/ppp/peers/IPv6VPN , the first two lines are added for reconnect on fails.

Code: [Select]
persist
maxfail 0
pty "pptp tserv3.fmt2.ipv6.he.net --nolaunchpppd"
lock
noauth
nobsdcomp
nodeflate
name bearice%63106
remotename IPv6VPN
ipparam IPv6VPN
updetach
then goto /etc/network/interfaces
add these lines:
Code: [Select]
auto he-vpn
iface he-vpn inet ppp
        provider IPv6VPN

auto he-ipv6
iface he-ipv6 inet6 v4tunnel
        endpoint 72.52.104.74
        local    184.104.13.193
        address  2001:470:1f04:cab::2
        netmask  64
        gateway 2001:470:1f04:cab::1
        mtu      1420
        ttl      255

this will make your tunnel connected on startup.
however you would find the 6in4 tunnel not working now:
Quote
Both the PPTP server and the 6in4 server have the same IPv4 address,  Since routing normally only pays attention to destination addresses, and because the PPTP software puts a host route into the main routing table for the HE server so that the PPTP traffic doesn't try to use the ppp0 interface itself, a "special case" route is put in so that when the source IPv4 matches the PPTP assigned IP, it uses a different routing tabled (called "pptp" in this case), which has the default route pointing through the ppp0 interface.  This way, "normal" traffic uses your standard default route, and traffic originating from the PPTP IPv4 (such as your 6in4 tunnel's traffic) takes the PPTP tunnel.
thanks to jimb for explanation
add a route table first:
Code: [Select]
echo "1 pptp" >> /etc/iproute2/rt_tablesthen create file /etc/ppp/ip-up.d/vpn_route and chmod +x it:
Code: [Select]
#!/bin/sh -e
ip route add default dev $PPP_IFACE table pptp
ip rule add from $PPP_LOCAL table pptp
exit 0
and /etc/ppp/ip-down.d /vpn_route:
Code: [Select]
#!/bin/sh -e
ip route del default dev $PPP_IFACE table pptp
ip rule del from $PPP_LOCAL table pptp
exit 0
by now, you can use "ifup he-vpn" to bring PPTP tunnel up and use "ping6 2001:470:1f04:cab::1" to have a test.
at last, thank to HE.net for tunnelbroker service ;)
« Last Edit: June 24, 2010, 05:00:12 AM by bearice »
Logged

jimb

  • Hero Member
  • *****
  • Posts: 805
  • ^^^ Warped picture
Re: HowTo: Create 6in4 Tunnel with PPTP in Ubuntu
« Reply #1 on: June 23, 2010, 05:13:24 PM »

May want to change where I said "admin" to "pptp", 'cause I was refering to mthode's posts where he calls the new routing table "admin".  I typically don't bother naming it and just use the number, but I guess naming the table is nice.
Logged

patrickdk

  • Jr. Member
  • **
  • Posts: 67
Re: HowTo: Create 6in4 Tunnel with PPTP in Ubuntu
« Reply #2 on: June 23, 2010, 08:39:08 PM »

I would remove the up and down commands, kind of makes things look more complex than needed and add:

    gateway 2001:470:1f04:cab::1
Logged

jimb

  • Hero Member
  • *****
  • Posts: 805
  • ^^^ Warped picture
Re: HowTo: Create 6in4 Tunnel with PPTP in Ubuntu
« Reply #3 on: June 23, 2010, 10:12:39 PM »

I bet you could also set it up to "demand dial" the PPTP so it all comes up automagically as soon as an IPv6 packet heads towards the PPTP pipe (which would happen as soon as a 6in4 packet went out), but I can't remember how to do it.  Meh.  Probably easier just to turn it up through an init script.  :P
Logged

bearice

  • Newbie
  • *
  • Posts: 7
Re: HowTo: Create 6in4 Tunnel with PPTP in Ubuntu
« Reply #4 on: June 24, 2010, 05:03:50 AM »

fixed  :)
Logged