Monthly Archives: October 2008

I was trying to set up a friend’s Xbox 360 on my home network that uses a D-Link DI-624 router (Rev. C) with version 2.76 firmware and a brand new Motorola Netopia 2210-02 ADSL modem, but I wasn’t able to connect to Xbox Live.

My Xbox, which had been connected for months with an Open NAT while using a old Siemens Speedstream 4100 modem, never had any problems connecting.

I double checked all the connections, powercycled the Xbox, then ran the network tests from the System blade. It would pass all of the tests up until the Xbox Live test, at which point it would fail spectacularly and restart the tests – but this time displaying a “Disconnected” message at the Network Adapter test.

I bypassed the router and plugged the Xbox straight into the DSL modem and was able to connect, but with a Strict NAT. (I should have realized the significance of this right away, but I didn’t.)

So I reconnected the router and kept experimenting. After a while, I noticed that my computers connected to the router also lost their connections when I tried to sign in to Xbox Live.

As it turns out, the suspicious-looking disconnection message was accurate – something the Xbox was doing was causing the router to reboot.

I Googled around and found a few good posts about this problem.

First, I disabled UPnP on the D-Link router thanks to the advice in this Ars Technica forum post. Then I configured it to assign the Xbox a static IP address and then put that IP address in the DMZ. Now the Xbox was able to connect to Xbox Live, but the NAT status was Strict.

I wasn’t going to settle for that, though. I wanted to get an Open NAT.

So I took it out of the DMZ and port forwarded UDP 88 and both UDP & TCP 3074 ports to the static IP address, but the NAT status was still Strict.

Giving the Xbox a static IP address and forwarding the ports had fixed similar connection issues and permitted an Open NAT for almost everyone else, why wasn’t it working for this setup?

More Googling finally turned up the explanation. The Motorola Netopia 2210 contains a NAT router, so no matter what I did with the D-Link’s settings, I was going to keep getting the Strict NAT from the modem as long as it was handling the PPPoE. (This is what I should have realized earlier, when I was connecting the Xbox directly to the modem.)

The Motorola/Netopia 2210 is also a router with full DHCP functions and may not function correctly when connected directly to another router. Not changing the modem to Bridged Ethernet may result in double NAT’ing, increased latency, possible IP conflicts, or possibly a network that doesn’t work at all.
http://www.dslreports.com/faq/15855

The solution was to configure the modem to use “Bridged Ethernet” mode and set up PPPoE on the router.

As long as you’re setting up PPPoE on the router, you may want to select “Keep Alive” or “Always On”, if those options are available, or set the Maximum Idle Time to “0”. You should also confirm that the MTU value is “1492” and that value is used on all the devices on the network.

Also note that the Motorola Netopia 2210 has an “Internet” light that lights up green whenever there is an active PPPoE session initiated by it. The light will stay off when the PPPoE session is initiated by a router or other device.

A client wanted me to implement a drop down contact form that was triggered when the cursor hovered over a button in the site’s navigation. This was no problem, and I delivered some code using script.aculo.us‘s blind effect. A few hours later, the client contacted me and said that as he moved his cursor around the screen, he kept accidently triggering the contact form as the cursor moved through the element, and couldn’t I find a way to make the action a little more deliberate.

As far as I can tell, there is a way to delay a blind effect in script.aculo.us, but no way to stop the effect once the delay’s countdown has begun.

I searched around and came upon a w3schools JavaScript tutorial about timing events and the setTimeout() and clearTimeout() methods. This was exactly what I needed. By calling a function that started a countdown to the event rather than the event itself, and later calling a function that cancelled the countdown, it is possible to abort the drop down action if the mouse was moved out of the element within a specified time interval.

The code snippet below assumes you have links to the script.aculo.us and prototype libraries in place already. As the cursor enters the link, the startForm() function is called and a 500 ms timer begins. If the cursor moves out of the link, the stopForm() function is called, and the timer is cancelled. If stopForm() is called before the timer finishes counting, the effect never happens.

The client’s happy and I learned something useful.

The Code

<script type="text/javascript"><!--//--><![CDATA[//><!--
var t
function startForm() {
	t=setTimeout("Effect.toggle('contactform','blind')",500);
}
function stopForm() {
	clearTimeout(t);
}
//--><!]]></script>

A simple demonstration of how to implement this using inline JavaScript (a no-no).

<ul id="nav">
	<li><a href="#">a link</a></li>
	<li><a href="#">a link</a></li>
	<li><a href="#" onmouseover="startForm()" onmouseout="stopForm()">Contact Us</a></li>
</ul>
<div id="contactform">
        <!-- the form goes here -->
</div>

This post explains how to set up an IIS 5.1 server on your home network for serving web pages, and then add it to your Workgroup so you can edit those pages from a different PC without the need for an FTP server and client.

You’ll need a PC running Windows 2000, XP Professional, or 2003. The different operating systems offer different versions of IIS, with 5.0 and 6.0 being much more full-featured than the 5.1 version that ships with XP Professional. But if all you want to do is test ASP pages and serve them to computers on your home network, 5.1 should suffice.

I’m using an ancient Compaq Armada laptop with a 700 MHz Intel Pentium III and 192 MB RAM. I did a clean install of XP, and it works surprisingly smoothly. I’m serious.

If you want your server to be accessible from outside the LAN, you’ll have to look elsewhere for instructions. I’m not comfortable advising anyone on the security risks of doing that.

Install IIS

Find your Windows XP Professional installation CD and pop it in. Open your Control Panel -> Add or Remove Programs -> Add/Remove Windows Components. Check the box next to Internet Information Services (IIS) and click Next to install. The default settings for the components should be fine.

Open a browser and enter “http://localhost/localstart.asp” into the address bar to confirm the server is running. You’ll likely be prompted for your username and password. You don’t need to go any further if you don’t want to.

Add the PC to your Workgroup

Right click My Computer -> Properties -> Computer Name tab. Click the Change button and enter the name of your Workgroup. Click Ok to save the change and then reboot.

Share the web folders

Open Windows Explorer and navigate to “C:\”. Right-click on the “Inetpub” folder and select “Sharing and security…” Either run through the Network Setup Wizard, or just start sharing the folder. (If you run through the wizard, you’ll be asked how your computer connects to the Internet. Chances are you’ll want to select “Other” at the first opportunity. It’s head-slappingly annoying that there are only five possible choices, yet Microsoft decided to spread them across two pages of options, and then put the two most likely choices on the second page.)

Navigate to “C:\Inetpub” and share the “wwwroot” folder. For some reason, this needs to be shared specifically, while the other folders at this level inherit sharing from the “Inetpub” folder.

Confirm you can access the folders from your primary PC. In Windows Explorer, navigate to My Network Places -> Entire Network -> Microsoft Windows Network -> Workgroup -> <your_server> -> Inetpub -> wwwroot.

Turn on the server

If the server isn’t running automatically after the reboot, open your Control Panel -> Administrative Tools -> Internet Information Services. You might want to right-click and drag this to make a shortcut on the desktop. (The IIS control panel is located at “%SystemRoot%\system32\inetsrv\iis.msc”.)

Drill down to “Web Sites” -> “Default Web Site”, right-click and select Start.

You can also create Virtual Directories, if you like, from the right-click menu.

Add a test folder (optional)

I’d recommend creating a folder in “C:\Inetpub\wwwroot\” called “test” or something and throwing a simple index.html file into it. If you browse to http://localhost on the server, you’ll be prompted for a username and password, but if you browse to a subfolder, such as http://localhost/test/index.html, you’ll get right in. This makes testing your setup from another PC easier.

Once you can get to http://localhost/test/index.html from the server, continue.

Open the Windows Firewall port

Open your Control Panel -> Windows Firewall -> Exceptions tab. Click on “Add Port”, name it HTTP, enter “80” as the port number and leave “TCP” selected. Click OK.

The web server can now act like one and respond to non-local port 80 requests.

Get the IP address

Start -> Run. Type “CMD” and click OK. Type “ipconfig” and press Enter. Jot down the IP address.

You will probably want to make this IP address static. I’ve found that doing it from the router’s admin panel is better than doing it from that connection’s properties.

Browse to the site from another PC on the LAN

Open a browser and enter http://192.168.x.x/test/index.html

You should be looking at your test page. You should also be able to connect using the server’s name instead of the IP address.