OpenWrt Forum Archive

Topic: Basic Setup/Config

The content of this topic has been archived on 19 Apr 2018. There are no obvious gaps in this topic, but there may still be some posts missing at the end.

http://www.speednet.name/tbarber/network.jpg

After looking over multiple possible configs, I just can't seem to find something that matches what I am looking to do so I made this diagram in hopes it makes life easier to explain.
Currently, my wireless is working just fine, but I would like to  use my WRT54GL to basically act as a AP client (I believe I have the term correct based upon the Linksys setup for my WAP54G device). In essence, I want to be able to plug devices into the VLAN jacks and have the traffic get forwarded out the wireless over to the access point. Plus I don't need the DHCP in the WRT54GL because I have DHCP requests being serviced from the Linux server.

So my question is this, is this possible? I am thinking that this should be a simple and common setup, but I have myself wound so tight that I second guess myself for what interface I am actually assigning the 172.16.1.6 to.

yes, it's possible. Just use your wireless in sta mode :

/etc/config/wireless

config 'wifi-device' 'wl0'
        option 'type' 'broadcom'
        option 'disabled' '0'
        option 'channel' '6'

config 'wifi-iface'
        option 'device' 'wl0'
        option 'ssid' 'yourssid'
        option 'network' 'lan'
        option 'mode' 'sta'
        option 'encryption' 'psk2'
        option 'key' 'yourkey'

and disable the dhcp server on your wrt54g

(Last edited by zorxd on 30 Apr 2009, 04:31)

Client-mode (STA) may not work. Try to use WDS.

What about assigning the IP? Does that IP get assigned to the wireless device or the eth0 which normally would get connected to a cable modem?

Sorry for the long delay, but I was able to finally get OpenWrt installed on my device. I think I have made all of the changes, but when I plug in a device to the lan connections, they are not able to get an IP. To cheat, I did turn off all encryption on my working wireless just to make life easier for now.

So here is what I have done:
1) ran the following commands:
nvram set boot_wait=on
nvram set boot_time=10
nvram commt && reboot

2) disabled dns/dhcp since I have both running elsewhere:
/etc/init.d/dnsmasq disable

I have tried both "sta" and "wds" option for the "wifi-iface" with the same results. Based upon what I read, I would have thought that the requests coming in from the lan connections would have been forwarded out the wl0 connection.

Here is my /etc/config/wireless:
config wifi-device  wl0
        option type     broadcom
        option channel  6

config wifi-iface
        option device   wl0
        option network  lan
        option mode     wds
        option ssid     TheZoo
        option encryption none

And here is my /etc/config/network
#### VLAN configuration
config switch eth0
        option vlan0    "0 1 2 3 5*"
        option vlan1    "4 5"


#### Loopback configuration
config interface loopback
        option ifname   "lo"
        option proto    static
        option ipaddr   127.0.0.1
        option netmask  255.0.0.0


#### LAN configuration
config interface lan
        option type     bridge
        option ifname   "eth0.0"
        option proto    static
        option ipaddr   172.16.1.5
        option netmask  255.255.255.0


#### WAN configuration
config interface        wan
        option ifname   "eth0.1"
        option proto    dhcp

Well, I was finally able to get my my system to run just like I wanted, and I am embarrassed as to how easy it was. First, I am running the latest 2.4 version.

Step 1:
Ran the following commands. I believe the purpose is to tell the device to NOT use NVRAM settings but use configuration files.

nvram set boot_wait=on
nvram set boot_time=10
nvram commt && reboot

Step 2:
Since I have DHCP/DNS running elsewhere, I had to turn off the DHCP/DNS on the Linksys device. Once the command is run, you might want to make sure that the file in /etc/rc.d/S60dnsmasq is not there anymore.

/etc/init.d/dnsmasq disable

Step 3:
I had to modify the /etc/config/network file assign the new IP address as well as setup the wan IP as well

#### VLAN configuration
config switch eth0
        option vlan0    "0 1 2 3 5*"
        option vlan1    "4 5"


#### Loopback configuration
config interface loopback
        option ifname   "lo"
        option proto    static
        option ipaddr   127.0.0.1
        option netmask  255.0.0.0


#### LAN configuration
config interface lan
        option type     bridge
        option ifname   "eth0.0"
        option proto    static
        option ipaddr   172.16.1.6
        option netmask  255.255.255.0
        option gateway  172.16.1.1 
        option dns      172.16.1.2


#### WAN configuration
config interface        wan
        option ifname   "eth0.1"
        option proto    dhcp

Step 4:
I then had to change the /etc/config/wireless file to turn on the radio and set the options for my wireless network.

config wifi-device  wl0
        option type     broadcom
        option channel  6
        option disabled 0

config wifi-iface
        option device   wl0
        option network  lan
        option mode     sta
        option ssid     "xxxxxx"
        option encryption none

Step 5:
I finally had to change the /etc/config/firewall to allow the forwarding of traffic.

config defaults
        option syn_flood        1
        option input            ACCEPT
        option output           ACCEPT
        option forward          ACCEPT

config zone
        option name             lan
        option input    ACCEPT
        option output   ACCEPT
        option forward  ACCEPT

config zone
        option name             wan
        option input    ACCEPT
        option output   ACCEPT
        option forward  ACCEPT
        option masq             1

config forwarding
        option src      lan
        option dest     wan
        option mtu_fix  1

(Last edited by dekernel on 26 Jun 2009, 21:06)

The discussion might have continued from here.