Tuesday, April 22, 2014

How I Made My Google Chromecast Work In Hotels

If there has ever been a more useful and inexpensive way to send High Definition video from my phone to my television before the Google Chromecast I have yet to see it.

The Google Chromecast comes in at a cost of $35.00 USD in a very compact package. [1]

In this posting I will outline how I was able to get my Google Chromecast to work with hotel provided WiFi using my Debian Linux laptop.

Because this is meant to be an outline there will be no screenshots but I will provide text examples for anyone with the technical know how to use as a

starting point.

Lets begin.

The first step was to purchase a second WiFi network Interface. I chose to use the Tenda W311M Wireless N150 Nano USB [2] since it works out of the box with Linux and because of it's small size it is easy to leave plugged into my laptop USB port without worrying about it getting snagged or broken.


Configure your built in WiFi to connect to the hotel WiFi Access point.

Plug in the second WiFi adapter.


On my Debian Linux laptop I installed hostapd and dnsmasq to support the WiFi Access Point and DHCP address I will need for my phone and my Google Chromecast to connect to my laptop.


First things first, lets install the packages we need:

apt-get update

apt-get install dnsmasq

apt-get install hostapd


This is my /etc/dnsmasq.conf

# -====================

port=0
interface=wlan3
domain=laptop
dhcp-range=192.168.0.50,192.168.0.150,12h
dhcp-option=42,0.0.0.0

# -====================



This is my /etc/hostapd/hostapd.conf

# -========================

interface=wlan3
driver=nl80211
dump_file=/tmp/hostapd.dump
ssid=ADDYOURSSIDHERE
ieee80211d=1
hw_mode=g
channel=11
beacon_int=100
dtim_period=2
max_num_sta=255
rts_threshold=2347
fragm_threshold=2346
macaddr_acl=0
auth_algs=3
ignore_broadcast_ssid=1
ieee80211n=0
own_ip_addr=127.0.0.1
wpa_key_mgmt=WPA-PSK-SHA256 WPA-EAP-SHA256 WPA-PSK WPA-EAP

# -==================================-

Execute the following to start it all up:

/etc/init.d/hostapd start

/etc/init.d/dnsmasq start


Execute the following so all traffic now goes in/out through the primary WiFi interface:

/sbin/iptables -v -t nat -A POSTROUTING -o wlan0 -j MASQUERADE

NOTE - The SSID is NOT broadcast so make sure to add it by hand!!!
Attach your phone/tablet to the laptop SSID.

Attach your Chromecast you your laptop SSID.

Start Casting! :)



1. Google Chromecast
2. Tenda W311M_150Mbps_Wireless_N_USB_20_Adapter



UPDATE: April 23, 2014

I don't use Microsoft Windows but someone passed these commands to me to make a MS-Windows-7 system into a WiFi Access Point. This should also work with a second WiFi interface.

1. Enable Windows Internet Connection Sharing

2. Open a Command Console in MS-Windows-7+ and try the following.
NOTE: Please change PASSWORD to something more secure. :)

netsh wlan set hostednetwork mode=allow ssid=SECURE key=PASSWORD keyUsage=persistent

netsh wlan stop hostednetwork

netsh wlan start hostednetwork

netsh wlan show hostednetwork


No comments: