# Windows, Wifi and local lan



## drhowarddrfine (Oct 12, 2011)

I moved in with my son while my house is being remodeled. I have a Windows laptop that I connect to his home network wirelessly. I have a Linksys WRT54G that I would like to use with two FreeBSD boxes on a local network but also with the Windows notebook wired in. I changed the IP of the router to 192.168.1.2 and started the local addresses at 192.168.1.200. I left DHCP on and plugged the ethernet cables for all the computers into the lan side only.

This worked once. I was able to ping the FreeBSD boxes and tried to connect via ssh. It asked me to accept the security stuff for ssh and, after saying "yes", it hung. Any attempts afterwards only gets me a port rejected response.

I switched everything off, then on, but now none of that works and, plugging the ethernet cable from the laptop to the router blocks internet access on the Windows computer.

I so rarely deal with the networking side once it's set up that I tend to forget everything. Hints or tips please.


----------



## SirDice (Oct 12, 2011)

Since you're not using any of the wireless of the WRT54G why don't you just buy a cheap (10-15 euro) switch?


----------



## drhowarddrfine (Oct 12, 2011)

Because I have the WRT54G. I already own a switch but how would the FreeBSD boxes get local IP addresses?


----------



## SirDice (Oct 12, 2011)

I assume there's already a modem and router that connects to the internet. That also has a DHCP server built-in. You don't need the one in your WRT54G as everything will end up on the same subnet anyway. The existing router will serve the IP addresses.


----------



## drhowarddrfine (Oct 12, 2011)

But the router isn't connected to the modem or any other router. I only want it connected to the Windows laptop via ethernet.


----------



## SirDice (Oct 12, 2011)

How are you connected to the internet?


----------



## drhowarddrfine (Oct 12, 2011)

The laptop connects to the internet via wifi from my son's wireless modem/router.


----------



## SirDice (Oct 12, 2011)

I figured something like that. If I'm not mistaken you can set the WRT54G as a wireless client. Use that to connect the WRT54G to your son's wireless network. Turn off the DHCP service on the WRT54G, IP addresses will be served by your son's router. Connect all your machines to the ethernet ports on the WRT54G.


----------



## drhowarddrfine (Oct 12, 2011)

I found a HOWTO on that. The FreeBSD boxes do not need to be on the 'net though that would be nice. Maybe I need to look into "bridging"?


----------



## SirDice (Oct 12, 2011)

No need for that, the WRT54G will bridge automatically. This basically means that all your machines will become part of the same network as your son's.

All you have to do is turn on DHCP on your machine, and yes, your FreeBSD machine would then also be able to connect to the internet using your son's network.


----------



## drhowarddrfine (Oct 12, 2011)

Have to leave for a while but will come back to this. Thanks.


----------



## drhowarddrfine (Oct 12, 2011)

What did you mean,"turn on DHCP on your machine"? I assume you mean the Windows laptop but I don't know how to do that unless you mean with ICS in Sharing?

I thought this thread would do the trick but after I change the IP address of the router, I can access it for only about a minute till I lose it altogether. 

So this didn't fall into place easily and I'm poking around too much but I don't have the thought to put too much thought into it. Appreciate any help.


----------



## bbzz (Oct 12, 2011)

He meant use dhcp on your hosts to acquire ip addresses. 
Sorry if I'm missing anything, why do u want to use linksys router if your son already has one?

Did you connect it like this:


```
Laptop!----->!Linksys--------son's_router----Internet
              [no dhcp]      [dhcp]
```


----------



## drhowarddrfine (Oct 13, 2011)

Son's wifi router-->laptop-->wrt54g-->freebsd


----------



## bbzz (Oct 13, 2011)

Connect WRT54G to your son's router with ethernet cable. Turn off DHCP/routing on WRT54G so that it works like regular switch. Let your son's router handle all DHCP. Now your FreeBSD boxes wired in WRT54G, as well as windows laptop should belong to the same network.


----------



## PseudoCylon (Oct 13, 2011)

drhowarddrfine said:
			
		

> plugged the ethernet cables for all the computers into the lan side only.


The laptop need to be plugged in wan/internet (not wlan, wan, this isn't a typo) port. Because wrt54g run as NAT by default, it should have 2 IP addresses, one for wan facing side (received from son's router), one for lan side you should give one (preferably someting like 192.168.[red]2[/red].1). DHCP on wrt54g handles adresses for boxes connected to lan ports. (Unless you configure wrt54g as bridge or set port forwarding, the laptop won't be able to ssh any of freebsd boxes. If you do bridge, you need to turn off DHCP on wrt54g.)



			
				drhowarddrfine said:
			
		

> It asked me to accept the security stuff for ssh and, after saying "yes", it hung. Any attempts afterwards only gets me a port rejected response.


Did you run sshd (ssh server) on the box being ssh'd?


----------



## drhowarddrfine (Oct 13, 2011)

bbzz said:
			
		

> Connect WRT54G to your son's router with ethernet cable.


I can't. It's physically too far. It's wireless only. I want to be able to network on a local lan between the notebook and the freebsd machines but, far preferably, have wifi available to the notebook, at least.


----------



## drhowarddrfine (Oct 13, 2011)

PseudoCylon said:
			
		

> The laptop need to be plugged in wan/internet (not wlan, wan, this isn't a typo) port. Because wrt54g run as NAT by default, it should have 2 IP addresses, one for wan facing side (received from son's router), one for lan side you should give one (preferably someting like 192.168.[red]2[/red].1). DHCP on wrt54g handles adresses for boxes connected to lan ports. (Unless you configure wrt54g as bridge or set port forwarding, the laptop won't be able to ssh any of freebsd boxes. If you do bridge, you need to turn off DHCP on wrt54g.)


I tried that first but it's been so long I think I'll try it again in case I did something wrong.


> Did you run sshd (ssh server) on the box being ssh'd?


There are two of those boxes and both are from my home office where I've done that for years.


----------



## SirDice (Oct 13, 2011)

Turn off ICS on the windows laptop, you don't need it. Set it to automatically get an IP address (DHCP).

You'll end up with something like this:


```
[Son's wifi router]--(wireless)----[WRT54G]--(wired)--[FreeBSD/Windows]
```

Turn off NAT and the DHCP service on the WRT54G, it should be a straight bridge.


----------



## ecazamir (Oct 13, 2011)

If I remember correctly, WRT54G (and most Linksys routers as well) can't be used as WiFi client with the official firmware.
I suggest the following configuration:

```
/Son's router/ -> /WiFi/Windows Laptop
                           /ethernet/
                        WRT54G used as switch, DHCP should not be used
                           /ethernet/
                        FreeBSD Box
```
There is a even easier solution, requiring only a crossover cable, since you say that the FreeBSD box do not require internet connection:

```
/Son's router/ -> /WiFi/Windows Laptop
                           /ethernet port/
                        Cross over ethernet cable
                           /ethernet port/
                        FreeBSD Box
```

If you need non-permanent internet connection on the FreeBSD box, you could use:

```
/Son's router/ -> /WiFi/Windows Laptop, WiFi and Local Area Connections bridged, Automatic IP assigned on the bridge
                           /ethernet/
                        WRT54G used as switch, DHCP disabled / or / Cross over ethernet cable
                           /ethernet/
                        FreeBSD Box, ethernet configured with DHCP
```


----------



## bbzz (Oct 13, 2011)

drhowarddrfine said:
			
		

> I can't. It's physically too far. It's wireless only. I want to be able to network on a local lan between the notebook and the freebsd machines but, far preferably, have wifi available to the notebook, at least.



Ah, ok, I got it now. It wasn't clear why you need WRT router.

In this case, you need to get a new firmware for your router, since the stock doesn't support bridging. I have the same setup. Go to http://www.dd-wrt.com/site/index and get new firmware. Then setup your router to be in "repeater bridge mode". Turn off DHCP, NAT, regular routing. This will allow you to connected everything to your own router (via cable or wifi), which will then pass everything to your son's router via wifi.


----------



## drhowarddrfine (Oct 13, 2011)

Yeah, I've tried all the ideas above. It's interesting I'm able to connect for a minute or so but I presume the addresses are getting released and disconnect me. Thanks guys.


----------

