Setup Cisco IOS for incoming IPSEC VPN from iPhone or iPad

To setup a Cisco router to accept incoming L2TP/IPSEC from an iPhone or iPad, follow these instructions:

Pre-requisites:
- Cisco router with IOS that supports IPSEC/L2TP (I use advanced IP services k9 12.4(24)T1 on a 877 router)

ip dhcp pool vpn-pool
   import all
   network 172.16.3.0 255.255.255.0
   dns-server 203.0.178.191 139.130.4.4 <change your DNS servers here>
   domain-name xxx.com

vpdn enable
!
vpdn-group L2TP
! Default L2TP VPDN group
 accept-dialin
  protocol l2tp
  virtual-template 2
 no l2tp tunnel authentication

username aaa password 7 <PASSWORD_HERE>

crypto keyring L2TP 
  pre-shared-key address 0.0.0.0 0.0.0.0 key <SECRET_HERE>
!
crypto isakmp policy 1
 encr 3des
 authentication pre-share
 group 2
 lifetime 3600
crypto isakmp keepalive 3600
!
crypto ipsec security-association lifetime seconds 600
!
crypto ipsec transform-set TS1 esp-3des esp-sha-hmac 
 mode transport
!
crypto dynamic-map DYN_MAP 10
 set nat demux
 set transform-set TS1 
!
!
crypto map CRYP_MAP 6000 ipsec-isakmp dynamic DYN_MAP 
!

interface Virtual-Template2
 ip unnumbered Loopback0
 ip nat inside
 ip virtual-reassembly
 peer default ip address dhcp-pool vpn-pool
 ppp mtu adaptive
 ppp authentication chap ms-chap
 ppp ipcp dns 203.0.178.191 139.130.4.4

interface Dialer0 (or any other internet facing interface)
 ip nat outside
 crypto map CRYP_MAP

On iPhone/iPad
- Settings/Network/VPN/Add VPN
- Select L2TP, server address
- Account is the user in "username aaa password xxx", aaa in this example
- RSA SecureID = OFF
- Password = password in "username xxx password xxx"
- Secret is the IPSEC preshared secret in "pre-shared-key address 0.0.0.0 0.0.0.0 key <SECRET_HERE>"
- Send All Traffic = ON
- Proxy = OFF (or put your settings here)

HTTP Live streaming to Apple iPhone/iPad on a MAC

These are instructions to quickly setup HTTP Live streaming on a MAC. You will be able to serve the contents of a Media folder, or remote streams (eg. dreambox) via a web interface.

Pre-requisites:
- MAC running 10.6
- VLC installed. I used 1.0.5
- Admin access to the MAC.


Steps:

1. Download the tar ball http_streaming.tgz
2. Open a terminal window
3. Untar
tar xzvf http_streaming.tgz
4. Edit index.php and change the variables $mediapath to where your movie files are, and $user to your username. Save the changes
5. Launch the installer:
sudo ./stream_install.sh

(Optionally you can do sudo ./stream_install.sh -f to overwrite previous installation)

The installer script will do the following:
- Enable php
- Start the web server
- Copy the files to /Library/WebServer/Documents/stream and /usr/local/bin
- Add permission for the _www user to execute /bin/ls and /usr/local/bin/stream.pl scripts
- Launch Safari pointing to the new setup

The initial screen will display all media files in the $media directory as links.
Clicking on the links will start a VLC transcoding process in the background, and redirect the browser to the HTTP live stream

For remote media source, include the URL in a file with suffix .url in the media directory.
Eg. my dreambox is specified in dreambox.url as:

http://dreambox:31344

Where dreambox is the hostname/ipaddress and 31344 is the streaming port

From iPad/iPhone, point Safari to http://<Mac_Hostname_or_Address/stream

Click here to download:
http_streaming.tgz (2 KB)