LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Wireless Networking (https://www.linuxquestions.org/questions/linux-wireless-networking-41/)
-   -   home network using linksys wireless router (https://www.linuxquestions.org/questions/linux-wireless-networking-41/home-network-using-linksys-wireless-router-596749/)

davimint 11-02-2007 10:01 PM

home network using linksys wireless router
 
Hello all,
I own a wireless router (wrt54gs) and I need some help on the
configuration if someone knows a good guide or maybe has some advice.

Here's my network layout.

Internet
|
|
eth0
(firewall/server )eth1 ------ (wired pc)
eth2
|
|
linksys ------- (wirless pc) & (wirelss pc)


I've configured dhcpd on the server

Code:

  ddns-update-style none;
subnet 192.168.1.0 netmask 255.255.255.0
{
        range 192.168.1.25 192.168.1.50;
        option subnet-mask 255.255.255.0;
        option broadcast-address 192.168.1.255;
        option domain-name-servers 68.87.68.162, 68.87.74.162;
        option routers 192.168.1.1;
        default-lease-time 21600;
        max-lease-time 43200;
}
subnet 192.168.2.0 netmask 255.255.255.0
{
        range 192.168.2.100 192.168.2.150;
        option subnet-mask 255.255.255.0;
        option broadcast-address 192.168.2.255;
        option domain-name-servers 68.87.68.162, 68.87.74.162;
        option routers 192.168.2.1;
        default-lease-time 21600;
        max-lease-time 43200;
}

here's my network card info.
Code:

# Config information for eth0:
IPADDR[0]=""
NETMASK[0]=""
USE_DHCP[0]="yes"
DHCP_HOSTNAME[0]=""

# Config information for eth1:
IPADDR[1]="192.168.1.1"
NETMASK[1]="255.255.255.0"
USE_DHCP[1]=""
DHCP_HOSTNAME[1]=""

# Config information for eth2:
IPADDR[2]="192.168.2.1"
NETMASK[2]="255.255.255.0"
USE_DHCP[2]=""
DHCP_HOSTNAME[2]=""

here's routing information

Code:

Destination    Gateway        Genmask        Flags  MSS Window  irtt Iface
192.168.2.0    0.0.0.0        255.255.255.0  U        0 0          0 eth2
192.168.1.0    0.0.0.0        255.255.255.0  U        0 0          0 eth1
76.xxx.xxx.0    0.0.0.0        255.255.248.0  U        0 0          0 eth0
127.0.0.0      0.0.0.0        255.0.0.0      U        0 0          0 lo
0.0.0.0        76.xxx.xxx.1    0.0.0.0        UG        0 0          0 eth0

also, my almost no firewall !! for now.

Code:

#!/bin/bash
iptables -F
iptables -t nat -F
iptables -t mangle -F
iptables -X
iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE
iptables -A FORWARD -s 192.168.1.0/24 -j ACCEPT
iptables -A FORWARD -s 192.168.2.0/24 -j ACCEPT
echo 1 > /proc/sys/net/ipv4/ip_forward

I can swap the cables on eth1 and eth2 to my wired pc and everything works so I know that the dhcpd sever is working on both interfaces or at least one at a time.

I have failed at all my attempts to get the wireless pc's working through the server so any help would be appreciated.

michaelk 11-03-2007 12:00 AM

How are you connecting the router into your network? Are you using the WAN or a LAN port connected to eth2? You can configure your router as a wireless access point in a nutshell by plugging into the LAN (the switch side) and disabling DHCP. You can also simplify your network by just plugging the router into eth1 and then all computers will be on the same subnet.

davimint 11-03-2007 01:55 AM

michaelk,
The answer to your questions is that I have tried both with several combinations of settings on the router itself. Just a little bit ago I got the crazy thing working. But I'm afraid that there may be some conflict at some point in the way it's set up. Currently it is plugged into the WAN port from eth2 and I reset the router to factory defaults.

Here's the routers routing table.

Code:

Destination LAN IP          Subnet Mask          Gateway          Interface
0.0.0.0        0.0.0.0        192.168.2.1        WAN (Internet)
192.168.1.0        255.255.255.0        192.168.1.1        LAN & Wireless
192.168.2.0        255.255.255.0        192.168.2.149        WAN (Internet)

I feel sure you can look at that routing table and get a better idea of whats going on. The reason for using two cards and subnets was for security, for the most part I was just trying to be safe.

From what I've read and googled I should be able to just plug into one of the LAN ports and disable dhcp and it should work just like you said. I'm going to give it another try and see.

Thanks for the advice.

davimint 11-03-2007 02:20 AM

Follow up to previous post:
Ok, Now the router is hooked to the LAN port and eth2 and I disabled DHCP Server on the router and set the Routers IP address to 192.168.2.149.
It's working !!!!!!!

The routers routing tables looks better also.

Code:

Destination LAN IP          Subnet Mask          Gateway          Interface
192.168.2.0        255.255.255.0        192.168.2.149        LAN & Wireless

It handed me a local address of 192.168.2.148.

I still have two more questions.

First, before I was setting the ROUTERS IP address to what I thought was the gateway for eth0 ( 192.168.2.1 ) and this time I just set it to an address inside the range of the DHCP server on the firewall box. I would like to understand that.

Second, if anyone knows there a section in the routers setup under advanced routing that says I should have the router set to "router" but I still have it set to "Gateway". If someone could explain that to me it would be much appreciated.

Thanks again and any comments welcome.

michaelk 11-03-2007 01:23 PM

Each device on the same subnet requires a unique IP address. So that is why you had problems when the routers LAN address the same as eth2 (i.e. 192.168.2.1) on the server. The netmask i.e. 255.255.255.0 in a nutshell determines the available hosts on the subnet. In your case 192.168.2.x where x=1 to 254. 255 is assigned the broadcast address and zero is the network address. You would want to set the routers LAN IP address to something outside the DHCP IP address range (<100 or >150) so no conflicts can occur. The DHCP server actually assigns address from the top down (150,149 etc) so if you have at least 3 wireless clients your going to have an IP conflict.

Google for more information.

davimint 11-03-2007 01:48 PM

Thanks, I get what your saying..I'll get it changed.


All times are GMT -5. The time now is 05:53 PM.