Dave Burke : Freelance .NET Web Developer specializing in Online Communities

TCPIP Multihost config on standalone W2K3 server

Those of you I've been corresponding with about my laptop-less presentation situation for CC3 know I've decided to take my CPU to the party. The rationale is that all of my dotText sites are on it which I want to demo in real time and I want to easily walk through several VS.NET dotText solutions. Nutty, but makes perfect sense to me. It also allows me to spend all of my time preparing for the presentation rather than reconfiguring everything to run on a borrowed laptop, ghost my system on an external drive I don't have, whatever. 

Okay, time to unplug the rascal from the network and make sure I'm ready to rock in standalone mode. I'm no TCP/IP Rocket Science specialist, but I figured I could add a few entries in the hosts and lmhosts files and I'd be good to go. No way, Jose'. My packets were going nowhere, not even to all of the resident web sites on the box. I reconfigured its networking every way I knew how and nothing worked. My hosts and lmhosts file addresses were being ignored and packets seemed to be dying when they hit the NIC. 

Here's where raw idiocy comes in (or brilliance...okay, idiocy.) I've been around TCP/IP long enough to know that there's something called loopback involved. Time to pass the ol' TCP/IP buck! So I grabbed a linksys router sitting around and plugged the server into it (and rebooted.) The linksys router was powered-up and not connected to a thing, but it provided the loopback I needed to make every IP bound to my NIC light-up and stay lit!  So it looks like I'll be bringing a CPU and a linksys router.

I know this is coming.  Someone will comment something like, "Gee-zus. You are such an loser. Just check the loopback checkbox!" And I'd say, "THANKS!" But I'm pretty sure there isn't a loopback checkbox though. There may be some c:\>ipDoSomethingNutty -/WithSomeWeirdAssSwitch statement I could run probably. In the meantime, a nerd (of moderate-to-low intelligence) does what a nerd's gotta do.

Comments (12) | Post RSS RSS comment feed

Posted on 3/4/2005 6:11:00 AM by Dave Burke
Categories: .NET | Everyday
Tags:

Related posts

Comments (12) -

3/4/2005 11:54:00 AM Permalink

Interesting.

I have a 2 server setup at home - my workstation and a web/sql server - both connected to my little home lan. (Actually I have a 3-server setup: the third is running linux/Apache/PostgreSQL, but that doesn't matter in this tale - and of course there is the wife's computer and the kids' computer, etc).  

I have a bunch of IP addresses assigned to my webserver, with a different IP assigned to each web site and then I just use host files on each machine that point "friendly" names to the different IP addresses: for example I might have entries for blog1.mynetwork.com, blog2.mynetwork.com, etc.  

I have never wondered what would happen if I unplugged my webserver from the network.  I had assumed I would still be able to access the sites that are on it because of using the hosts files.  I had not considered that since those IPs are tied to the NIC that they websites wouldn't work if the NIC wasn't "working".  I'm going to have to give that a try.

Dan Hounshell |

3/4/2005 12:14:00 PM Permalink

Dan,  Thanks so much for such a thoughtful response.  I'm very much looking forward to your experimenting with this, though its such an academic pursuit that I won't mind if you don't happen to get around to it.

Yeah, I just assumed the host files would handle IP assignment and routing.  It might also be a W2K3 issue as well with its more stringent functions regarding access.

One nice thing about this solution is that it requires absolutely no reconfiguration and is purely a hardware fix.

Thank you again for stopping by.

Dave Burke |

3/4/2005 1:28:00 PM Permalink

Hey Dave,

Good plan to take your machine.  I did a small presentation about a month or so ago.  I'd been through everything on my computer a couple of times to make sure I had it down.  I went out to visit the presentation organiser at work the day before the presentation to make sure he had everything on his laptop that I needed.  Boy - that was worthwhile - we found a couple of things that were missing.  He assured me he'd get the missing bits and pieces on later that night when he could connect the laptop to the net.

Anyways - the next day at the presentation, it turns out he'd missed some stuff.   (If he's reading your blog, I'll take this opportunity to blow a rasberry at him :-P )  I tried to make do with what we had - but boy it threw me off when I got to the part I was supposed to be demoing.  I kind of stumbled out an explanation in 10 seconds of what I was supposed to demonstrate over 5 minutes, and moved on.  I felt silly, and worse, unprepared.  

Next time I'll be taking my own box.

Tim Haines |

3/4/2005 2:56:00 PM Permalink

Dave,

I don't quite get what you are trying to do, but there has to be an easier way.  Are you interesting in binding the web server to a specific IP or host name?  If it is just host name you should be able to put those in the hosts file like you said and make them point to 127.0.0.1 which is virtual loopback address.  The hosts file is major hack on Windows IMHO.  It shows Microsoft's roots in the BSD code base.



Christopher Baus |

3/4/2005 3:32:00 PM Permalink

Christopher, I hate it when I sound confusing.  You're right, there has to be an easier way (thanks for not calling me a loser), but as for pointing to 127.0.0.1, they are.  I have 10 or so IPs bound to the NIC (each representing a separate IIS site) and I don't use localhost at all, or rarely.  

Both hosts and lmhosts look like this:

127.0.0.1       localhost

169.69.69.108   dbvtcs
169.69.69.98   dbvtcom
169.69.69.103   edublog
169.69.69.104   dottext

(Its an internal LAN with numbers I've been using for 10 years, and "69" is a happy number..)

So I need to go to http://dbvtcs, http://dbvtcom, etc.  I couldn't even go to http://169.1.1.108">http://169.1.1.108.  I would disable the network card, then enable it where I could ping the IPs and aliases.  Then when trying to hit any of the sites in IE (IP or alias), Windows would spin its wheels looking for IP resolution.

And I agree, somehow /windows/system32/drivers/etc/hosts isn't as elegant as a Linux /etc/hosts file, where it makes perfect sense.   BSD roots for sure.  Thanks!

Dave Burke |

3/7/2005 4:54:00 PM Permalink

I create a loopback on my laptop for presentations to do exactly what you are trying to do. It allows me to connect to web sites, SQL Server, etc.

How to install the Microsoft Loopback adapter in Windows XP
support.microsoft.com/default.aspx">support.microsoft.com/default.aspx

I set it to a similar port as what I use online (DHCP from my router). Piece of cake. Smile

Robert Hurlbut |

3/7/2005 6:18:00 PM Permalink

Thanks, Robert.  I certainly wasn't aware of the Loopback adapter.  That's very interesting.  

Because I use hardcoded IPs on the box and have multiple web sites and so forth (and because its getting close to Code Camp and I'm a chicken when it comes to screwing with my TCP/IP configuration on my primary development server), I'm going to stay with my "hardware-only" solution for this week.  That way the only thing I need to do is plug my box into a router and don't have to change a thing.

Seriously, thanks for the info on the adapter.

Dave Burke |

3/7/2005 6:29:00 PM Permalink

No problem -- anytime.  I think you can even set it to be the same IP as your existing when the real card is not available, but hey, why chance it? Smile

Robert Hurlbut |

3/22/2005 2:17:00 PM Permalink

I ran across a similar problem today and the sln might have worked for you too.  I was in a situation where a machine needed to be able to see its own local share when disconnected from the network.  I should have come here first to see the replys, and I would have tried Robert's solution with the loopback.

Without it, though, I was able to fix the problem with the details from this newsgroup post.  Not sure if it would have worked for your issue or not, but it certainly fixed ours.  

groups-beta.google.com/.../76229c7716586836">groups-beta.google.com/.../76229c7716586836

Aaron Junod |

3/22/2005 3:37:00 PM Permalink

Aaron,  So that thread was about accessing a Share while disconnected, but you're saying if we simply follow the last post, we'll retain TCP/IP while disconnected?  Interesting.  Might have to try that one if I ever bring a desktop to do a presentation again (like at Code Camp 4 Smile  Thanks so much for the info.

You have to add


[HKEY_LOCAL_MACHINE\SYSTEM\Cur­rentControlSet\Services\Tcpip
\Parameters]
"DisableDHCPMediaSense"=dword:­00000001


to your registry. This keeps W2K from turning off TCP/IP
when no cable is attached

Dave Burke |

3/23/2005 8:57:00 AM Permalink

I haven't tried it yet for your setup, but I'm thinking it should work.  I think the root cause of the issues were the same.  This just stops windows from flipping out when you disconnect the network cable.  I'm anxious to know if it fixes it though.  I'll prolly try tonight.

Aaron Junod |

3/23/2005 8:58:00 AM Permalink

Thanks, Aaron.  Please let us know.

Dave Burke |


Powered by BlogEngine.NET 2.0.0.36
Theme by Dave Burke